-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
33 lines (25 loc) · 840 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
FROM hexpm/elixir:1.18.1-erlang-27.2-debian-bookworm-20241223 as builder
# Create appuser
RUN useradd -ms /bin/bash appuser
# Get the source code
WORKDIR /opt/test-runner
COPY . .
# Compile the formatter
WORKDIR /opt/test-runner/exercism_test_helper
RUN mix local.rebar --force && \
mix local.hex --force && \
mix deps.get && \
MIX_ENV=test mix compile && \
mix test --no-compile
# Build the escript
RUN MIX_ENV=prod mix escript.build && \
mv exercism_test_helper /opt/test-runner/bin
FROM hexpm/elixir:1.18.1-erlang-27.2-debian-bookworm-20241223 as runner
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /opt/test-runner /opt/test-runner
# Install SSL ca certificates
RUN apt-get update && \
apt-get install bash jo jq -y
USER appuser
WORKDIR /opt/test-runner
ENTRYPOINT ["/opt/test-runner/bin/run.sh"]