all the things you need to make it run in docker the stupid shit

1c47834 · gmorell · 2022-12-23 20:13

15 files +20 -5

Files changed

added .dockerignore
+1 −0
@@ -0,0 +1 @@
1 +meta/lex_metadata
modified Dockerfile
+5 −1
@@ -23,8 +23,12 @@ RUN mix release ${app_name} \
23 23 FROM alpine:latest
24 24 ARG project_id
25 25 RUN apk update \
26 − && apk --no-cache --update add bash ca-certificates openssl-dev libgcc libstdc++ libcrypto1.1
26 + && apk --no-cache --update add bash ca-certificates openssl-dev libgcc libstdc++ libcrypto1.1 iproute2
27 27 EXPOSE ${PORT}
28 28 WORKDIR /opt/app
29 29 COPY --from=0 /opt/release .
30 +RUN mkdir -p /opt/app/meta && \
31 + cd /opt/app/meta \
32 + && /opt/app/bin/start_server eval ":dets.open_file(:lex_metadata, [type: :set])"
33 +ENV PHX_SERVER=true
30 34 CMD exec /opt/app/bin/start_server start
modified README.md
+4 −2
@@ -35,10 +35,12 @@ A Reimplementation of Lambent Aether 4, in Elixir
35 35
36 36 ## Running
37 37 ```
38 −docker pull lambentri/labmentex
39 −docker run lambentex
38 +docker pull lambentri/lambentex
39 +docker run --net=host -d --restart always --mount type=bind,source"$(pwd)"/lex_metadata,target=/opt/app/lex_metadata lambentri/lambentex
40 40 ```
41 41
42 +Then load host:4000 in your web browser
43 +
42 44 ## Development
43 45
44 46 To start your Phoenix server:
modified config/prod.exs
+2 −1
@@ -10,7 +10,8 @@ import Config
10 10 # which you should run after static files are built and
11 11 # before starting your production server.
12 12 config :lambent_ex, LambentExWeb.Endpoint,
13 − cache_static_manifest: "priv/static/cache_manifest.json"
13 + cache_static_manifest: "priv/static/cache_manifest.json",
14 + check_origin: :conn
14 15
15 16 # Do not print debug messages in production
16 17 config :logger, level: :info
modified lib/lambent_ex/scan/8266-7777.ex
+1 −1
@@ -9,7 +9,7 @@ defmodule LambentEx.Scan.ESP8266x7777 do
9 9 @registry :lambent
10 10 @s "ꙭ📡"
11 11 @p "ꙭ👉"
12 − @filtered_prefixes ["br", "docker", "lo", "cni", "flannel"]
12 + @filtered_prefixes ["br", "docker", "lo", "cni", "flannel", "tun"]
13 13 @pubsub_name LambentEx.PubSub
14 14
15 15 def start_link(opts) do
modified lib/lambent_ex/scan/meta.ex
+2 −0
@@ -4,7 +4,9 @@ defmodule LambentEx.Meta do
4 4 @table :lex_metadata
5 5
6 6 def init(arg) do
7 + File.cd("meta")
7 8 {:ok, table} = :dets.open_file(@table, [type: :set])
9 + File.cd("..")
8 10
9 11 {:ok, %{table: table}}
10 12 end
added rel/overlays/bin/server
+3 −0
@@ -0,0 +1,3 @@
1 +#!/bin/sh
2 +cd -P -- "$(dirname -- "$0")"
3 +PHX_SERVER=true exec ./lambent_ex start
added rel/overlays/bin/server.bat
+2 −0
@@ -0,0 +1,2 @@
1 +set PHX_SERVER=true
2 +call "%~dp0\lambent_ex" start

Parents: b4d065d