chore: adds docker files
This commit is contained in:
20
backend/Dockerfile
Normal file
20
backend/Dockerfile
Normal 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"]
|
||||
15
backend/docker-compose.yml
Normal file
15
backend/docker-compose.yml
Normal 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
|
||||
Reference in New Issue
Block a user