-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
60 lines (41 loc) · 1 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
48
49
50
51
52
53
54
55
56
57
58
59
60
# Dockerfile
# Building for production
FROM elixir:1.17.3-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
RUN cd /opt/app && \
mix local.hex --force && \
mix local.rebar --force && \
mix deps.get
ENV NODE_OPTIONS=--openssl-legacy-provider
RUN npm install npm -g --no-progress && \
cd /opt/app/assets && \
npm ci && \
NODE_ENV=production npm run build
RUN mix phx.digest
RUN mix release
# Dockerfile
# Runing in production
FROM elixir:1.17.3-alpine as release
RUN apk add --no-cache bash git openssh openssl
RUN mkdir -p $HOME/.ssh
RUN touch $HOME/.ssh/id_rsa
RUN touch $HOME/.ssh/known_hosts
RUN chmod 600 $HOME/.ssh/id_rsa
RUN mkdir -p /opt/app
COPY --from=build /opt/app/_build/prod/rel/appcenter_dashboard /opt/app
ADD entrypoint.sh /entrypoint.sh
WORKDIR /opt/app
EXPOSE 4000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/opt/app/bin/appcenter_dashboard", "start"]