link to correct docker-compos file, based on environment

This commit is contained in:
Philip Henning 2025-01-28 20:35:50 +01:00
parent 2df35bf010
commit 0d7308fb4e
2 changed files with 6 additions and 1 deletions

View file

@ -50,6 +50,11 @@ while true; do
esac esac
done done
if [[ -f ./docker-compose.yml ]]; then
[[ "${DEPLOYMENT_ENVIRONMENT}" == "PRODUCTION" ]] && ln -s ./docker-compose.prod.yml ./docker-compose.yml
[[ "${DEPLOYMENT_ENVIRONMENT}" == "TEST" ]] && ln -s ./docker-compose.test.yml ./docker-compose.yml
fi
# Check if .env exists and exit if it is # Check if .env exists and exit if it is
if [[ ! -f ./.env ]]; then if [[ ! -f ./.env ]]; then
cat ./env.template >> ./.env cat ./env.template >> ./.env
@ -74,8 +79,8 @@ fi
[[ ! -d ./data/restic/ssh/ ]] && mkdir -p ./data/restic/ssh/ [[ ! -d ./data/restic/ssh/ ]] && mkdir -p ./data/restic/ssh/
[[ ! -f ./data/restic/ssh/id_ed25519 ]] && ssh-keygen -t ed25519 -C "sso.base23.de" -f ./data/restic/ssh/id_ed25519 [[ ! -f ./data/restic/ssh/id_ed25519 ]] && ssh-keygen -t ed25519 -C "sso.base23.de" -f ./data/restic/ssh/id_ed25519
# Generate dhparam, if not existing
if [[ "${DEPLOYMENT_ENVIRONMENT}" == "PRODUCTION" ]]; then if [[ "${DEPLOYMENT_ENVIRONMENT}" == "PRODUCTION" ]]; then
# Generate dhparam, if not existing
[[ ! -d ./data/nginx/certs ]] && mkdir -p ./data/nginx/certs && chmod 700 ./data/nginx/certs && chown 101:101 ./data/nginx/certs || true [[ ! -d ./data/nginx/certs ]] && mkdir -p ./data/nginx/certs && chmod 700 ./data/nginx/certs && chown 101:101 ./data/nginx/certs || true
[[ ! -f ./data/nginx/dhparams.pem ]] && echo "" && openssl dhparam -out ./data/nginx/dhparams.pem 4096 && chown 101:101 ./data/nginx/dhparams.pem \ [[ ! -f ./data/nginx/dhparams.pem ]] && echo "" && openssl dhparam -out ./data/nginx/dhparams.pem 4096 && chown 101:101 ./data/nginx/dhparams.pem \
&& echo "" && echo "Checking generated dhparams" && openssl dhparam -check -in ./data/nginx/dhparams.pem || true && echo "" && echo "Checking generated dhparams" && openssl dhparam -check -in ./data/nginx/dhparams.pem || true