1.7 KiB
1.7 KiB
Deployment
Branch strategy
develop: test/staging deploymentsmain: production deployments- keep one private GitHub repository
Local development
- current
docker-compose.ymlremains the development stack - use
.envor.env.dev.exampleas the template
Test deployment server
- copy
.env.test.exampleto.env.teston the server - recommended path:
/opt/workdock/.env.test - current test target:
192.168.2.55
Production deployment server
- copy
.env.prod.exampleto.env.prodon the server - use HTTPS and secure cookies in production
Server bootstrap
Install:
gitdockerdocker compose plugincurl
Recommended app directory:
/opt/workdock
First clone on server
git clone git@github.com:OWNER/REPO.git /opt/workdock
cd /opt/workdock
cp .env.test.example .env.test
Test deploy manually
cd /opt/workdock
./scripts/deploy_stack.sh .env.test docker-compose.prod.yml
Production deploy manually
cd /opt/workdock
./scripts/deploy_stack.sh .env.prod docker-compose.prod.yml
GitHub Actions secrets
Development environment
TEST_DEPLOY_HOSTTEST_DEPLOY_USERTEST_DEPLOY_SSH_KEYTEST_DEPLOY_PORTTEST_DEPLOY_PATH
Production environment
PROD_DEPLOY_HOSTPROD_DEPLOY_USERPROD_DEPLOY_SSH_KEYPROD_DEPLOY_PORTPROD_DEPLOY_PATH
Important note for the test server
.env.test.example is intentionally configured for an HTTP LAN test deployment.
That means RUN_DJANGO_CHECK=0 is used in the test deploy workflow, because the application security checks require secure cookies when DEBUG=0.
For real production, use .env.prod behind HTTPS and keep RUN_DJANGO_CHECK=1.