chore: add deployment infrastructure

This commit is contained in:
Gleb Korotkiy
2026-06-21 11:08:30 +03:00
parent 5996c9e212
commit b99ec0c4f4
7 changed files with 259 additions and 10 deletions

39
Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
# 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;"]