From d65d866292370c41025a7f7dcdda304746ce0c59 Mon Sep 17 00:00:00 2001 From: South Drifted Date: Thu, 5 Oct 2023 15:41:38 +0000 Subject: [PATCH] feat: add Docker configuration files --- Dockerfile | 19 +++++++++++++++++++ docker-compose.yml | 26 ++++++++++++++++++++++++++ package-lock.json | 8 +++----- package.json | 2 +- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..af72359 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:18-slim + +USER root + +RUN npm rm yarn -g + +RUN mkdir /home/node/app +WORKDIR /home/node/app + +COPY package.json package-lock.json file-content-injector.js /home/node/app/ +RUN npm i + +COPY . /home/node/app + +RUN npm prune --production || true \ + npm cache clean -f + +EXPOSE 3000 +CMD ["npm", "start"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..879baf4 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,26 @@ +version: '3' + +networks: + polyfiller: + +services: + api-service: + image: polyfiller/api-service + environment: + - NODE_ENV=production + ports: + - 3000:3000 + networks: + - polyfiller + restart: always + caddy: + depends_on: + - api-service + image: caddy + ports: + - 80:80 + - 443:443 + networks: + - polyfiller + restart: always + command: caddy reverse-proxy --from polyfiller.app --to api-service:3000 diff --git a/package-lock.json b/package-lock.json index a213f86..4c16ed5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "@wessberg/di": "2.1.0", "@wessberg/pointer-events": "1.0.9", "@wessberg/stringutil": "1.0.19", + "@wessberg/ts-config": "3.1.0", "blob-polyfill": "5.0.20210201", "browserslist": "4.21.5", "browserslist-generator": "2.0.3", @@ -84,7 +85,6 @@ "@typescript-eslint/parser": "5.48.2", "@wessberg/di-compiler": "3.2.0", "@wessberg/prettier-config": "1.0.0", - "@wessberg/ts-config": "3.1.0", "ava": "5.1.1", "eslint": "8.32.0", "eslint-config-prettier": "8.6.0", @@ -3632,8 +3632,7 @@ "node_modules/@wessberg/ts-config": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@wessberg/ts-config/-/ts-config-3.1.0.tgz", - "integrity": "sha512-/TqKHx3zgdDQKoqAemh4tBYQE873aN37BuaTeE5AFC3ZG/9oSVgkbuu32WErFsSHAnpdblpBuYJwhugUm0r7Xg==", - "dev": true + "integrity": "sha512-/TqKHx3zgdDQKoqAemh4tBYQE873aN37BuaTeE5AFC3ZG/9oSVgkbuu32WErFsSHAnpdblpBuYJwhugUm0r7Xg==" }, "node_modules/accepts": { "version": "1.3.7", @@ -18350,8 +18349,7 @@ "@wessberg/ts-config": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@wessberg/ts-config/-/ts-config-3.1.0.tgz", - "integrity": "sha512-/TqKHx3zgdDQKoqAemh4tBYQE873aN37BuaTeE5AFC3ZG/9oSVgkbuu32WErFsSHAnpdblpBuYJwhugUm0r7Xg==", - "dev": true + "integrity": "sha512-/TqKHx3zgdDQKoqAemh4tBYQE873aN37BuaTeE5AFC3ZG/9oSVgkbuu32WErFsSHAnpdblpBuYJwhugUm0r7Xg==" }, "accepts": { "version": "1.3.7", diff --git a/package.json b/package.json index bae7bfb..b7094b9 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "@typescript-eslint/parser": "5.48.2", "@wessberg/di-compiler": "3.2.0", "@rollup/plugin-json": "6.0.0", - "@wessberg/ts-config": "3.1.0", "@wessberg/prettier-config": "1.0.0", "ava": "5.1.1", "eslint": "8.32.0", @@ -93,6 +92,7 @@ "@wessberg/di": "2.1.0", "@wessberg/pointer-events": "1.0.9", "@wessberg/stringutil": "1.0.19", + "@wessberg/ts-config": "3.1.0", "lit": "2.6.1", "blob-polyfill": "5.0.20210201", "browserslist": "4.21.5",