-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
46 lines (26 loc) · 918 Bytes
/
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
FROM docker.io/hexpm/elixir:1.17.3-erlang-27.1.2-debian-bookworm-20241016-slim AS base
RUN apt-get -qq update && \
apt-get -qq -y install build-essential --fix-missing --no-install-recommends
ENV PROJECT_ROOT /src/ping_pong
ENV PATH ${PROJECT_ROOT}/bin:$PATH
WORKDIR ${PROJECT_ROOT}
# Install Hex+Rebar
RUN mix local.hex --force && \
mix local.rebar --force
COPY . .
RUN MIX_ENV=prod mix deps.get && \
MIX_ENV=prod mix deps.compile
RUN MIX_ENV=prod mix compile
RUN MIX_ENV=prod mix release
# ---- Application Stage ----
FROM debian:bookworm-20241016-slim AS app
ENV LANG=C.UTF-8
# Install openssl
RUN apt-get update && apt-get install -y openssl
ENV PROJECT_ROOT /src/ping_pong
ENV PATH ${PROJECT_ROOT}/bin:$PATH
WORKDIR ${PROJECT_ROOT}
COPY --from=base /src/ping_pong/_build .
LABEL maintainer="ahsan.dar@live.com"
EXPOSE 4001
ENTRYPOINT ["prod/rel/ping_pong/bin/ping_pong", "start"]