From 0a0168671c23fccb87fd8b74e13da18834f990c9 Mon Sep 17 00:00:00 2001 From: arriej Date: Sun, 31 Aug 2025 14:03:00 +0200 Subject: [PATCH] Add Docker files --- Dockerfile | 12 ++++++++++++ docker-compose.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/Dockerfile b/Dockerfile index e69de29..43c9779 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . . + +EXPOSE 3000 + +CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e69de29..bc2b0c1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -0,0 +1,29 @@ +version: '3.8' + +services: + app: + build: . + ports: + - "3000:3000" + env_file: + - .env + depends_on: + - db + volumes: + - .:/app + - /app/node_modules + + db: + image: postgres:16 + restart: always + environment: + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + ports: + - "5432:5432" + volumes: + - postgres_data:/var/lib/postgresql/data + +volumes: + postgres_data: \ No newline at end of file