Files
Craftstation/Dockerfile
2025-09-08 02:22:33 +02:00

28 lines
663 B
Docker

FROM alpine:latest
# runtime dependencies including C++ libraries for Bun
RUN apk add --no-cache curl bash ca-certificates libstdc++ libgcc
WORKDIR /app
# the pre-built binary with embedded assets
COPY craftstation .
# non-root user
RUN addgroup -g 1001 -S craftstation && \
adduser -S craftstation -u 1001 -G craftstation && \
chown craftstation:craftstation /app/craftstation
USER craftstation
ENV BUN_INSTALL="/home/craftstation/.bun"
ENV PATH="$BUN_INSTALL/bin:${PATH}"
EXPOSE 3000
ENV PORT=3000
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
CMD curl -f http://localhost:3000/ || exit 1
CMD ["./craftstation"]