Add production docker-compose file and update pipeline

This commit is contained in:
Keannu Christian Bernasol 2025-09-01 02:36:13 +08:00
parent babab64113
commit ef95f6d09d
3 changed files with 16 additions and 2 deletions

View file

@ -18,6 +18,7 @@ steps:
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa - echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa - chmod 600 /root/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
- wget -O $DOCKER_COMPOSE_URL
- ssh "$SSH_HOST" " - ssh "$SSH_HOST" "
cd "$PROJECT_DIRECTORY"; cd "$PROJECT_DIRECTORY";
docker-compose down; docker-compose down;

View file

@ -5,8 +5,7 @@
A Django REST Framework template for personal use in projects. A Django REST Framework template for personal use in projects.
- Emails (and templated email designs) - Pre-templated emails
- Caching (via Redis)
- Debug mode profiling (via Django Silk) - Debug mode profiling (via Django Silk)
- A working Woodpecker CI/CD template for automated deployments - A working Woodpecker CI/CD template for automated deployments

14
docker-compose.prod.yml Normal file
View file

@ -0,0 +1,14 @@
services:
# API
django:
env_file: .env
build:
context: .
dockerfile: Dockerfile
image: git.06222001.xyz/keannu125/drf_template:latest
ports:
- "${BACKEND_PORT}:8000"
environment:
- RUN_TYPE=api
volumes:
- ./src:/app/src # Bind mount for persistent schema.yml and static files