-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
47 lines (36 loc) · 1.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# docker build -t thundermoon:build .
FROM elixir:1.15.4-alpine
RUN apk add --no-cache build-base npm git python3 curl
WORKDIR /app
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# set build ENV
ENV MIX_ENV=prod
# install mix dependencies
COPY mix.exs mix.lock ./
COPY apps/game_of_life/mix.exs ./apps/game_of_life/mix.exs
COPY apps/lotka_volterra/mix.exs ./apps/lotka_volterra/mix.exs
COPY apps/sim/mix.exs ./apps/sim/mix.exs
COPY apps/thundermoon/mix.exs ./apps/thundermoon/mix.exs
COPY apps/thundermoon_web/mix.exs ./apps/thundermoon_web/mix.exs
RUN mix deps.get
# copy compile-time config files before we compile dependencies
# to ensure any relevant config change will trigger the dependencies
# to be re-compiled.
RUN mkdir -p config
COPY config/ ./config
RUN mix deps.compile
COPY apps/ ./apps
# note: if your project uses a tool like https://purgecss.com/,
# which customizes asset compilation based on what it finds in
# your Elixir templates, you will need to move the asset compilation
# step down so that `lib` is available.
WORKDIR /app/apps/thundermoon_web/assets
RUN npm ci
ENV NODE_ENV=production
RUN npx tailwindcss --input=css/app.css --output=../priv/static/assets/app.css --postcss --minify
RUN npx cpx "./static/**/*" ../priv/static
RUN npx cpx "./node_modules/line-awesome/dist/line-awesome/fonts/*" ../priv/static/fonts
WORKDIR /app
RUN mix esbuild default --minify