artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can Docker/Artanis run on a network server?


From: Mortimer Cladwell
Subject: Can Docker/Artanis run on a network server?
Date: Sat, 27 Mar 2021 02:41:09 -0400

Hello!
Has anyone gotten a Dockerified Artanis app to run on a LAN server?

In the table below I share my experience trying. The definition of the various columns are as follows:

Location: local - my office workstation; LAN - a server on the internal LAN with an ip of 192.168.1.17

Docker: yes - I am using docker running with the command "docker run --rm -p 3000:3000 -v /tmp:/myapp/pub/tmp myapp";
        no - I have guile and artanis installed on the OS (Debian 10) and I am using "art work" at a terminal prompt.

ip: the ip address in artanis.conf e.g. host.addr =127.0.0.1

entrypoint: the ip in the entrypoint command in Dockerfile e.g. 0.0.0.0 for the command "ENTRYPOINT [ "art", "work", "-h0.0.0.0" ]

success?: Yes - it worked; No - there are problems


location Docker ip entrypoint success?
======== ===== == ========== ========
local no 127.0.0.1 0.0.0.0 yes
LAN no 192.168.1.17 0.0.0.0 yes
local yes 127.0.0.1 0.0.0.0 yes

LAN yes 192.168.1.17 0.0.0.0 no
LAN yes 127.0.0.1 0.0.0.0 no
LAN yes 192.168.1.17 192.168.1.17 no
LAN yes 127.0.0.1 192.168.1.17 no




Failure has two varieties:
1. The only entrypoint I find that works is 0.0.0.0  All others give an error like:
In artanis/server/ragnarok.scm:
   630:10  4 (establish-http-gateway _)
   443:16  3 (ragnarok-http-gateway-run _)
    90:24  2 (ragnarok-open #:host _ #:family _ #:addr _ #:port _)
     70:4  1 (make-listen-socket 2 3232235793 3000)
In unknown file:
           0 (bind #<input-output: socket 24> 2 3232235793 3000)

ERROR: In procedure bind:
In procedure bind: Cannot assign requested address

2. With entrypoint 0.0.0.0 and artanis.conf host.addr 127.0.0.1 or 192.168.1.17 the app works as expected except for redirects i.e any controller that uses (redirect-to rc "/test/page2") will redirect me to:

0.0.0.0:3000/test/page2

which is a fail.  However if I manually substitute 192.168.1.17 for 0.0.0.0 in the browser address bar, I can get to page2.  So the problem I am having is with redirection.  All controllers that use (view-render "page1" (the-environment)) work fine.

Any ideas?
Are there other flags for art work (besides "-h")?

Thanks
Mortimer

===========================================================================================
My simplified controllers/views for testing redirection:


(define-artanis-controller test) ; DO NOT REMOVE THIS LINE!!!

(test-define page1
  (lambda (rc)
   (view-render "page1" (the-environment))
  ))

(post "/test/page1action"
(lambda (rc)
    (redirect-to rc "/test/page2")
    ))

(test-define page2
  (lambda (rc)
   (view-render "page2" (the-environment))
  ))

<html><body>
<h1>Page 1</h1>
<form action="" method="POST">
<input type="submit" value="Send Request">
</form></body>    </html>

<html><body>
<h1>Page 2</h1>
</body></html>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]