wip: currently rewriting the project as a full stack application
tangled.org/kacaii.dev/sigo
gleam
1ARG ERLANG_VERSION=28.0.2.0
2ARG GLEAM_VERSION=v1.14.0
3
4# Gleam stage
5FROM ghcr.io/gleam-lang/gleam:${GLEAM_VERSION}-scratch AS gleam
6
7# Build stage
8FROM erlang:${ERLANG_VERSION}-alpine AS build
9COPY --from=gleam /bin/gleam /bin/gleam
10COPY . /app/
11RUN apk add --no-cache build-base
12WORKDIR /app
13RUN gleam export erlang-shipment
14
15# Final stage
16FROM erlang:${ERLANG_VERSION}-alpine
17
18RUN \
19 addgroup --system webapp && \
20 adduser --system webapp -g webapp
21
22COPY --from=build /app/build/erlang-shipment /app
23COPY healthcheck.sh /app/healthcheck.sh
24
25RUN chmod +x /app/healthcheck.sh
26HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 CMD [ "/app/healthcheck.sh" ]
27
28WORKDIR /app
29
30ENTRYPOINT ["/app/entrypoint.sh"]
31CMD ["run"]