Closed jrstarke closed 6 years ago
I'm not able to replicate this, can you specify what docker image you're running?
As an aside, webpack compilation should not be happening inside the docker image if you are pulling from docker hub, are you building the image locally?
To clarify a bit: the docker image is not intended for developing the elixir project itself, as it produces a full production release, it is intended to be run locally to develop competition snakes against. Perhaps that wasn’t clear in the documentation.
If you wish to develop against a development build of the server then I would recommend checking out https://github.com/battle-snake/battle_snake#compiling-from-source
Docker output should look like:
> docker run -it -P --add-host="localhost:192.168.0.137" battlesnake/battle_snake:latest pre start hook... 20:51:46.852 [info] Loaded [bs] app 20:51:46.856 [info] Started [logger] app 20:51:46.856 [info] Running on node [bs@127.0.0.1] 20:51:46.856 [info] ===================================================== 20:51:46.856 [info] Storage Up Task 20:51:46.856 [info] ----------------------------------------------------- 20:51:46.856 [info] Creating schema on bs@127.0.0.1 20:51:46.939 [info] Schema already exists 20:51:46.939 [info] Done 20:51:51.227 [info] Loaded [bs] app 20:51:51.230 [info] Started [logger] app 20:51:51.230 [info] Running on node [bs@127.0.0.1] 20:51:51.230 [info] ===================================================== 20:51:51.230 [info] Migrate Task... 20:51:51.230 [info] ----------------------------------------------------- 20:51:51.230 [info] Booting dependencies... 20:51:51.375 [info] [ecto_mnesia] config: [host: :"bs@127.0.0.1", storage_type: :disc_copies] 20:51:51.375 [info] Running migrations for [BsRepo] 20:51:51.375 [info] Starting repos.. 20:51:51.380 [info] Running migrations for bs 20:51:51.386 [info] Migrations path: ./lib/bs-5.0.0/priv/bs_repo/migrations 20:51:51.386 [info] Repo config: [host: :"bs@127.0.0.1", storage_type: :disc_copies] 20:51:51.412 [info] Already up 20:51:51.412 [info] Done Exec: /app/_build/prod/rel/bs/erts-9.2/bin/erlexec -noshell -noinput +Bd -boot /app/_build/prod/rel/bs/releases/5.0.0/bs -boot_var ERTS_LIB_DIR /app/_build/prod/rel/bs/erts-9.2/../lib -env ERL_LIBS /app/_build/prod/rel/bs/lib -pa /app/_build/prod/rel/bs/lib/bs-5.0.0/consolidated -args_file /app/_build/prod/rel/bs/var/vm.args -config /app/_build/prod/rel/bs/var/sys.config -mode embedded -extra -- Root: /app/_build/prod/rel/bs 20:51:53.182 [info] Running BsWeb.Endpoint with Cowboy using http://0.0.0.0:3000 post start hook... 20:53:41.049 request_id=3cdp82fh4c7j6nhdj9qoca96oi1plb9g [info] GET / 20:53:41.050 request_id=3cdp82fh4c7j6nhdj9qoca96oi1plb9g [info] Sent 200 in 1000µs 20:53:45.103 request_id=peu8680siu4oh60gre47ppe8i42indhf [info] GET /new
Strange that you're not able to replicate this. I can replicate it perfectly.
I get the JavaScript Console error mentioned above by running docker run -it -p 3000:3000 battlesnake/battle_snake
, creating a new came, and passing it one of my previous snakes (which is still live), then clicking Show.
Further, if I run docker run -it -p 3000:3000 battlesnake/battle_snake cat /root/prod/lib/bs/priv/static/js/game-76287735d82777240a5dd816d6e6bd40.js | grep "Compilation"
you can see that the Error message mentioned above is actually compiled into the JS in the Docker image.
Hope that helps.
When running the docker image, if you attempt to start a game, the browser appears blank. Looking at the browser console, there is the following exception:
Looking into the docker image, the following throw is found in /root/prod/lib/bs/priv/static/js/game-76287735d82777240a5dd816d6e6bd40.js source code.