40 lines
890 B
Docker
40 lines
890 B
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
FROM oven/bun:1.3.9 AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
ENV HUSKY=0
|
|
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends nodejs \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY package.json bun.lock ./
|
|
|
|
RUN bun install --frozen-lockfile
|
|
|
|
COPY . .
|
|
|
|
RUN bun run apigen
|
|
RUN bun run build
|
|
|
|
|
|
FROM nginx:1.29-alpine AS runner
|
|
|
|
RUN apk add --no-cache gettext
|
|
|
|
COPY docker/nginx.conf.template /etc/nginx/templates/default.conf.template
|
|
COPY docker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
COPY --from=builder /app/dist/ /usr/share/nginx/html/
|
|
|
|
EXPOSE 80
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget -q -O /dev/null http://127.0.0.1/ || exit 1
|
|
|
|
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
|
CMD ["nginx", "-g", "daemon off;"]
|