-
Notifications
You must be signed in to change notification settings - Fork 233
Expand file tree
/
Copy pathContainerfile.runner
More file actions
51 lines (39 loc) · 1.13 KB
/
Containerfile.runner
File metadata and controls
51 lines (39 loc) · 1.13 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
51
FROM elixir:1.19-otp-28-alpine AS compile-image
ENV MIX_ENV=prod
WORKDIR /opt/app
RUN apk update && apk add --no-cache build-base git ca-certificates make curl \
&& mix local.hex --force \
&& mix local.rebar --force
COPY mix.exs .
COPY mix.lock .
COPY config ./config
COPY apps/runner/mix.exs apps/runner/mix.exs
COPY apps/phoenix_gon/mix.exs apps/phoenix_gon/mix.exs
COPY apps/codebattle/mix.exs apps/codebattle/mix.exs
RUN mix do deps.get --only prod, deps.compile
COPY ./apps/runner/ ./apps/runner/
RUN mix release runner \
&& mv _build/prod/rel/runner /opt/release
FROM elixir:1.19-otp-28-alpine AS runtime-image
ENV GOON_VERSION v1.1.1
RUN apk update && apk add --no-cache \
podman \
iptables \
fuse-overlayfs \
shadow \
slirp4netns \
ca-certificates \
git \
make \
curl \
vim
RUN curl -fsSL "https://github.com/alco/goon/releases/download/${GOON_VERSION}/goon_linux_amd64.tar.gz" \
| tar -xzC /usr/local/bin
ARG GIT_HASH
ENV APP_VERSION=$GIT_HASH
ENV PORT=4001
EXPOSE ${PORT}
WORKDIR /opt/app
COPY --from=compile-image /opt/release .
COPY Makefile Makefile
CMD ["/opt/app/bin/runner", "start"]