feat: docker

This commit is contained in:
2025-06-06 15:56:49 +03:00
parent 746c8ab0d7
commit a8356d9f20
3 changed files with 47 additions and 0 deletions

15
.dockerignore Normal file
View File

@@ -0,0 +1,15 @@
node_modules
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
Makefile
helm-charts
.env
.editorconfig
.idea
coverage*

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM oven/bun:alpine AS base
WORKDIR /usr/src/app
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
ENV NODE_ENV=production
RUN bun run build
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app/.next .next
COPY --from=prerelease /usr/src/app/package.json .
USER bun
EXPOSE 3000/tcp
ENTRYPOINT ["bun", "run", "start"]

5
docker-compose.yml Normal file
View File

@@ -0,0 +1,5 @@
services:
app:
build: .
ports:
- "3900:3000"