From 5220757e704e3ed38a58f81eaeacc611af5a3d15 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 11 Oct 2024 07:30:00 +1000 Subject: [PATCH] added docker support --- docker-compose.yml | 7 +++++++ dockerfile | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 docker-compose.yml create mode 100644 dockerfile diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..2dd8aad --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,7 @@ +services: + app: + build: . + ports: + - "3000:3000" + environment: + - NODE_ENV=development diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..6e57cce --- /dev/null +++ b/dockerfile @@ -0,0 +1,20 @@ +# Use an official Node.js runtime as a parent image +FROM node:14 + +# Set the working directory in the container +WORKDIR /app + +# Copy the package*.json files to the working directory +COPY package*.json ./ + +# Install the dependencies +RUN npm install + +# Copy the application code +COPY . . + +# Expose the port the application will run on +EXPOSE 3000 + +# Run the command to start the application when the container launches +CMD ["npm", "start"] \ No newline at end of file