refactor: slim down the backend containers (#4233)

* refactor: slim down the backend containers

* refactor: make containers run as non-root user in container

* chore: correct casing for the build stage definitions

* chore: remove docker compose version field as its obsolete

* chore: optimise chown and chmod into the COPY command itself

* chore: add package overrides for packages with reported vulns

* chore: add pnpm to containers + set workdir dir to the backend project

* fix: permission issues with the fe containers

* chore: define env variables on AIO
This commit is contained in:
Andrew Bastin
2024-08-08 11:31:13 +05:30
committed by GitHub
parent bbda18c728
commit afea75694f
12 changed files with 1256 additions and 442 deletions

View File

@@ -5,6 +5,10 @@
"author": "",
"private": true,
"license": "UNLICENSED",
"files": [
"prisma",
"dist"
],
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
@@ -56,7 +60,7 @@
"handlebars": "4.7.7",
"io-ts": "2.2.16",
"luxon": "3.2.1",
"nodemailer": "6.9.1",
"nodemailer": "6.9.14",
"passport": "0.6.0",
"passport-github2": "0.1.12",
"passport-google-oauth20": "2.0.0",

View File

@@ -39,8 +39,8 @@ const caddyProcess = runChildProcessWithPrefix(
'App/Admin Dashboard Caddy',
);
const backendProcess = runChildProcessWithPrefix(
'pnpm',
['run', 'start:prod'],
'node',
['/dist/backend/dist/main.js'],
'Backend Server',
);

View File

@@ -1,4 +1,8 @@
{
"extends": "./tsconfig.json",
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
"exclude": ["node_modules", "test", "dist", "**/*spec.ts"],
"compilerOptions": {
"declaration": false,
"sourceMap": false
}
}

View File

@@ -1,5 +1,5 @@
:80 :3000 {
try_files {path} /
root * /site
root * /site/selfhost-web
file_server
}