diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..14d477a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ghcr.io/gleam-lang/gleam:v1.14.0-erlang-alpine + +RUN apk add --no-cache elixir git libstdc++ openssl + +WORKDIR /app + +COPY gleam.toml manifest.toml ./ +COPY src/ ./src/ + +RUN gleam deps download && gleam build --target erlang + +RUN adduser -D -H spasteg && chown -R spasteg:spasteg /app + +ENV PORT=3000 +EXPOSE 3000 + +USER spasteg + +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD wget --no-verbose --tries=1 --spider http://localhost:3000/ || exit 1 + +ENTRYPOINT ["gleam", "run", "--target", "erlang", "--", "--no-halt"]