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