Jelajahi Sumber

Add Dockerfile and .dockerignore

BoiiButBot 1 tahun lalu
induk
melakukan
e0943f4794
2 mengubah file dengan 37 tambahan dan 0 penghapusan
  1. 14 0
      .dockerignore
  2. 23 0
      Dockerfile

+ 14 - 0
.dockerignore

@@ -0,0 +1,14 @@
+# Ignore node_modules folder
+node_modules/
+
+# Ignore npm debug log
+npm-debug.log
+
+# Ignore yarn debug log
+yarn-debug.log
+
+# Ignore yarn error log
+yarn-error.log
+
+# Ignore .env file
+.env

+ 23 - 0
Dockerfile

@@ -0,0 +1,23 @@
+# Use node.js as base image
+FROM node:latest
+
+# Set the working directory
+WORKDIR /usr/src/app
+
+# Copy package.json and package-lock.json to the working directory
+COPY package*.json ./
+
+# Install the dependencies
+RUN npm install
+
+# Copy the source code to the working directory (except the files in .dockerignore)
+COPY . .
+
+# Copy the .env.copy file to .env
+RUN cp .env.copy .env
+
+# Expose the port
+EXPOSE 3000
+
+# Start the application
+CMD ["npm", "run", "buy"]