diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6f91893 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Specify the base image +FROM node:14 + +# Set the working directory in the container +WORKDIR /usr/src/app + +# Copy package.json and package-lock.json +COPY package.json package-lock.json ./ + +# Install app dependencies +RUN npm install + +# Bundle app source +COPY . . + +# Your app binds to port 3000, so you'll use the EXPOSE instruction to have it mapped by the docker daemon +EXPOSE 3000 + +# Define the command to run your app +CMD [ "node", "server.js" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bef1c0e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3.8' +services: + web: + build: . + ports: + - "3000:3000" + environment: + NODE_ENV: development + volumes: + - .:/usr/src/app + - /usr/src/app/node_modules