Dockerfile and docker-compose are added correctly

This commit is contained in:
Kfir Dayan 2024-01-22 15:21:01 +02:00
parent bbabb3f75e
commit 1e37363dfb
3 changed files with 29 additions and 0 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
node_modules

16
Dockerfile Normal file
View file

@ -0,0 +1,16 @@
FROM node:18
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
ARG SERVER_PORT
ENV PORT $SERVER_PORT
EXPOSE $SERVER_PORT
CMD ["npm", "run", "start:dev"]

12
docker-compose.yaml Normal file
View file

@ -0,0 +1,12 @@
version: "3.8"
services:
nest-app:
build:
context: .
dockerfile: Dockerfile
args:
SERVER_PORT: ${SERVER_PORT}
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
env_file:
- .env