chore: adds docker files

This commit is contained in:
vakabunga
2026-03-02 23:22:40 +03:00
parent 6b6ce5cba1
commit b990149bc3
4 changed files with 69 additions and 17 deletions

20
backend/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM node:20-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
FROM node:20-alpine AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY tsconfig*.json ./
COPY src ./src
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY package.json ./
EXPOSE 3000
CMD ["npm","run","start"]

View File

@@ -0,0 +1,15 @@
services:
backend:
build: .
container_name: family-budget-backend
env_file:
- file.env
ports:
- "3000:3000"
restart: unless-stopped
networks:
- postgre_buget_default
networks:
postgre_buget_default:
external: true