From 178274b024bc9e6482f8ca7fb4ef71ec438f1bd0 Mon Sep 17 00:00:00 2001 From: Muhhamad Syauqi Jannatan <13521014@std.stei.itb.ac.id> Date: Thu, 16 Nov 2023 22:43:49 +0700 Subject: [PATCH] feat: docker --- Dockerfile | 21 +++++++++++++++++++++ docker-compose.yml | 7 +++++++ 2 files changed, 28 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb5b60b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Use an official Node.js runtime as a base image +FROM node:20.9.0 + +# Set the working directory in the container +WORKDIR /app + +# Copy package.json and package-lock.json to the working directory +COPY package.json . +COPY package-lock.json . + +# Install application dependencies +RUN npm install + +# Copy the application files to the working directory +COPY . . + +# Expose the port that the app will run on +EXPOSE 3000 + +# Define the command to run your application +CMD ["npm", "start"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..372c6fa --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +version: '3.8' +services: + web: + build: . + ports: + - "3000:3000" + -- GitLab