From f870966e70a121edcab0e553514a708effb67b23 Mon Sep 17 00:00:00 2001 From: Benjamin Langley Date: Fri, 2 Apr 2021 14:56:42 -0400 Subject: [PATCH] Add docker setup --- Dockerfile | 15 +++++++++++++++ build-docker-image.bat | 2 ++ docker-compose.yml | 9 +++++++++ 3 files changed, 26 insertions(+) create mode 100644 Dockerfile create mode 100644 build-docker-image.bat create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cc05e82 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:14 + +COPY package*.json ./ + +RUN npm i + +COPY src ./src +COPY tsconfig.json ./tsconfig.json + +RUN npm run build + +# Change this to be whichever port the application is running on +EXPOSE 8080 + +CMD npm run start diff --git a/build-docker-image.bat b/build-docker-image.bat new file mode 100644 index 0000000..82535f0 --- /dev/null +++ b/build-docker-image.bat @@ -0,0 +1,2 @@ +:: replace image_name below with the desired image tag name +docker build -t image_name . diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..cdbaaa7 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' + +services: + ts-node-starter: # Replace with the service name + image: ts-node-starter # Replace with the image name + container_name: ts-node-starter # Replace with the container name + restart: on-failure + ports: + - "8080:8080" # Replace with the correct ports"