-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (29 loc) · 956 Bytes
/
Dockerfile
File metadata and controls
32 lines (29 loc) · 956 Bytes
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
ARG ERLANG_VERSION=28.0.2.0
ARG GLEAM_VERSION=v1.12.0
# Gleam stage
FROM ghcr.io/gleam-lang/gleam:${GLEAM_VERSION}-scratch AS gleam
# Build stage
FROM erlang:${ERLANG_VERSION}-alpine AS build
COPY --from=gleam /bin/gleam /bin/gleam
COPY . /app/
RUN cd /app && gleam export erlang-shipment
# Final stage
FROM erlang:${ERLANG_VERSION}-alpine
ARG GIT_SHA
ARG BUILD_TIME
ENV GIT_SHA=${GIT_SHA}
ENV BUILD_TIME=${BUILD_TIME}
COPY healthcheck.sh /app/healthcheck.sh
RUN \
chmod +x /app/healthcheck.sh \
&& addgroup --system gleam_packages \
&& adduser --system gleam_packages -g gleam_packages
USER gleam_packages
COPY --from=build /app/build/erlang-shipment /app
VOLUME /app/data
LABEL org.opencontainers.image.source=https://github.com/gleam-lang/packages
LABEL org.opencontainers.image.description="Gleam Packages web application"
LABEL org.opencontainers.image.licenses=Apache-2.0
WORKDIR /app
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["run", "server"]