ci: sync production compose file
This commit is contained in:
@@ -104,6 +104,7 @@ jobs:
|
|||||||
|
|
||||||
scp -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new "$deploy_env" "$DEPLOY_USER@$DEPLOY_HOST:/srv/prod/socialize/.env"
|
scp -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new "$deploy_env" "$DEPLOY_USER@$DEPLOY_HOST:/srv/prod/socialize/.env"
|
||||||
rm -f "$deploy_env"
|
rm -f "$deploy_env"
|
||||||
|
scp -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new deploy/compose.yml "$DEPLOY_USER@$DEPLOY_HOST:/srv/prod/socialize/compose.yml"
|
||||||
|
|
||||||
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new "$DEPLOY_USER@$DEPLOY_HOST" \
|
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new "$DEPLOY_USER@$DEPLOY_HOST" \
|
||||||
'cd /srv/prod/socialize && set -a && . ./.env && set +a && ./deploy.sh'
|
'cd /srv/prod/socialize && set -a && . ./.env && set +a && ./deploy.sh'
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ http://<this-machine-lan-ip>:8080
|
|||||||
|
|
||||||
For preprod deployment, configure the `POSTGRES_PASSWORD`, `RESEND_API_KEY`,
|
For preprod deployment, configure the `POSTGRES_PASSWORD`, `RESEND_API_KEY`,
|
||||||
`RESEND_FROM_EMAIL`, and `JWT_SIGNING_KEY` Gitea secrets.
|
`RESEND_FROM_EMAIL`, and `JWT_SIGNING_KEY` Gitea secrets.
|
||||||
The deploy workflow writes the remote `.env` file before running the server deploy script.
|
The deploy workflow writes the remote `.env` file and syncs `deploy/compose.yml`
|
||||||
|
before running the server deploy script.
|
||||||
Use the raw Resend API key value for `RESEND_API_KEY`, without a `Bearer ` prefix.
|
Use the raw Resend API key value for `RESEND_API_KEY`, without a `Bearer ` prefix.
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
|
|||||||
47
deploy/compose.yml
Normal file
47
deploy/compose.yml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
services:
|
||||||
|
db:
|
||||||
|
image: postgres:16
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
environment:
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
volumes:
|
||||||
|
- ./postgres:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 20
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
|
||||||
|
api:
|
||||||
|
image: git.mapachotes.com/jbourdon/socialize-api:${SOCIALIZE_IMAGE_TAG}
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
depends_on:
|
||||||
|
db:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- ./blob-storage:/app/App_Data/blob-storage
|
||||||
|
expose:
|
||||||
|
- "8080"
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
|
||||||
|
web:
|
||||||
|
image: git.mapachotes.com/jbourdon/socialize-web:${SOCIALIZE_IMAGE_TAG}
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- api
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:8080:80"
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal:
|
||||||
Reference in New Issue
Block a user