-
-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathDockerfile
53 lines (41 loc) · 1.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
FROM node:18-alpine as node
WORKDIR /assets
COPY assets/package.json assets/package-lock.json /assets/
RUN npm install
#-------------------------
FROM elixir:1.15-otp-24-alpine
ARG MIX_ENV="dev"
ARG SECRET_KEY_BASE=""
ENV MIX_ENV="${MIX_ENV}"
ENV SECRET_KEY_BASE="${SECRET_KEY_BASE}"
WORKDIR /app
COPY . ./
COPY --from=node /assets/node_modules /app/assets/node_modules/
RUN \
echo "https://dl-cdn.alpinelinux.org/alpine/v3.18/main" > /etc/apk/repositories \
&& echo "https://dl-cdn.alpinelinux.org/alpine/v3.18/community" >> /etc/apk/repositories \
&& apk update
RUN \
apk add --no-cache --virtual=.build-deps \
build-base \
&& \
apk add --no-cache \
ca-certificates \
inotify-tools \
postgresql15-client \
curl \
make \
g++ \
git \
&& \
mix local.hex --force \
&& mix local.rebar --force \
&& mix deps.get \
&& mix deps.compile \
&& mix assets.deploy \
&& mix compile \
&& apk del --purge .build-deps \
&& rm -rf /tmp/* \
&& chmod u+x /app/entry.sh
EXPOSE 4000
CMD [ "/app/entry.sh" ]