From ef95f6d09d3ce4c66c4585671bfcd9b2905ae7e3 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Mon, 1 Sep 2025 02:36:13 +0800 Subject: [PATCH] Add production docker-compose file and update pipeline --- .woodpecker/.deploy.yml | 1 + README.md | 3 +-- docker-compose.prod.yml | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 docker-compose.prod.yml diff --git a/.woodpecker/.deploy.yml b/.woodpecker/.deploy.yml index 76f7913..a5f4134 100644 --- a/.woodpecker/.deploy.yml +++ b/.woodpecker/.deploy.yml @@ -18,6 +18,7 @@ steps: - echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa - chmod 600 /root/.ssh/id_rsa - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config + - wget -O $DOCKER_COMPOSE_URL - ssh "$SSH_HOST" " cd "$PROJECT_DIRECTORY"; docker-compose down; diff --git a/README.md b/README.md index 06a4e69..f46e996 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ A Django REST Framework template for personal use in projects. -- Emails (and templated email designs) -- Caching (via Redis) +- Pre-templated emails - Debug mode profiling (via Django Silk) - A working Woodpecker CI/CD template for automated deployments diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml new file mode 100644 index 0000000..3832a82 --- /dev/null +++ b/docker-compose.prod.yml @@ -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 \ No newline at end of file