chore: make Docker image rootless (#683)

* add first version of rootless docker image

* skip user creation if user is already a non root user
This commit is contained in:
Elias Schneider
2024-12-18 16:08:45 +01:00
committed by GitHub
parent 168038eae7
commit 6771bfdf50
4 changed files with 42 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
#!/bin/sh
# Copy default logo to the frontend public folder if it doesn't exist
cp -rn /tmp/img/* /opt/app/frontend/public/img
# Start Caddy
if [ "$TRUST_PROXY" = "true" ]; then
caddy start --config /etc/caddy/Caddyfile.trust-proxy &
else
caddy start --config /etc/caddy/Caddyfile &
fi
# Run the frontend server
PORT=3333 HOSTNAME=0.0.0.0 node frontend/server.js &
# Run the backend server
cd backend && npm run prod
# Wait for all processes to finish
wait -n