From e0943f47944b978d54b8905b71f0200583e7d721 Mon Sep 17 00:00:00 2001 From: BoiiButBot Date: Thu, 8 Feb 2024 23:49:56 +0700 Subject: [PATCH] Add Dockerfile and .dockerignore --- .dockerignore | 14 ++++++++++++++ Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a46dae1 --- /dev/null +++ b/.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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..596bdf0 --- /dev/null +++ b/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"] \ No newline at end of file