-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (34 loc) · 753 Bytes
/
Dockerfile
File metadata and controls
50 lines (34 loc) · 753 Bytes
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
48
49
50
# Dockerfile
# Building for production
FROM elixir:1.19.5-alpine as build
RUN mkdir -p /opt/app
COPY . /opt/app
WORKDIR /opt/app
ENV MIX_ENV=prod
RUN apk --no-cache --update add \
g++ \
gcc \
git \
libc-dev \
make \
nodejs \
npm \
python3
RUN cd /opt/app && \
mix local.hex --force && \
mix local.rebar --force && \
mix deps.get
RUN npm install npm -g --no-progress && \
npm --prefix assets ci && \
mix assets.deploy
RUN mix phx.gen.release
RUN mix release
# Dockerfile
# Running in production
FROM elixir:1.19.5-alpine as release
RUN apk add --no-cache bash openssl
RUN mkdir -p /opt/app
COPY --from=build /opt/app/_build/prod/rel/store /opt/app
WORKDIR /opt/app
EXPOSE 4000
ENTRYPOINT ["/opt/app/bin/server"]