-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (34 loc) · 1.06 KB
/
Copy pathDockerfile
File metadata and controls
50 lines (34 loc) · 1.06 KB
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
# syntax=docker/dockerfile:1
ARG ELIXIR_VERSION=1.18.4
ARG OTP_VERSION=27
ARG DEBIAN_VERSION=bookworm
FROM elixir:${ELIXIR_VERSION}-otp-${OTP_VERSION}-slim AS builder
RUN apt-get update -y && \
apt-get install -y --no-install-recommends build-essential git curl ca-certificates sqlite3 libsqlite3-dev && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN mix local.hex --force && mix local.rebar --force
ENV MIX_ENV=prod
COPY mix.exs mix.lock ./
COPY config config
RUN mix deps.get --only ${MIX_ENV}
RUN mix deps.compile
COPY lib lib
COPY priv priv
COPY assets assets
RUN mix compile
RUN mix assets.deploy
RUN mix release
FROM debian:${DEBIAN_VERSION}-slim AS runner
RUN apt-get update -y && \
apt-get install -y --no-install-recommends libstdc++6 openssl libncurses6 sqlite3 ca-certificates curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
ENV MIX_ENV=prod \
PHX_SERVER=true \
PORT=4000 \
DATABASE_PATH=/data/open_drive.db
RUN mkdir -p /data
COPY --from=builder /app/_build/prod/rel/open_drive ./
EXPOSE 4000
CMD ["/app/bin/open_drive", "start"]