From 1e37363dfbb6c2fd235a7ee54f6898f7bcdb3c52 Mon Sep 17 00:00:00 2001 From: Kfir Dayan Date: Mon, 22 Jan 2024 15:21:01 +0200 Subject: [PATCH] Dockerfile and docker-compose are added correctly --- .dockerignore | 1 + Dockerfile | 16 ++++++++++++++++ docker-compose.yaml | 12 ++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b56a601 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..01fd7d2 --- /dev/null +++ b/docker-compose.yaml @@ -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 \ No newline at end of file