From c66dbf9dc39549836b7c8ac774afe0d48bd00f61 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Mon, 3 Aug 2026 13:02:48 +0500 Subject: [PATCH 01/12] Test CI/CD file added --- .gitea/workflows/ci_cd_test.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitea/workflows/ci_cd_test.yaml diff --git a/.gitea/workflows/ci_cd_test.yaml b/.gitea/workflows/ci_cd_test.yaml new file mode 100644 index 0000000..c537cc6 --- /dev/null +++ b/.gitea/workflows/ci_cd_test.yaml @@ -0,0 +1,19 @@ +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "🖥️ The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + - run: echo "🍏 This job's status is ${{ job.status }}." -- 2.52.0 From c455bd541b66005c77d3a207050e36b792fcdb19 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 10:55:15 +0500 Subject: [PATCH 02/12] New test action added. It builds a docker image and pushes it to the registry --- .gitea/workflows/build_image.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .gitea/workflows/build_image.yaml diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml new file mode 100644 index 0000000..b731b29 --- /dev/null +++ b/.gitea/workflows/build_image.yaml @@ -0,0 +1,31 @@ +name: Build and Push Docker Image + +on: + push: + branches: [ "ci-cd" ] + +env: + REGISTRY: git.vmn.su + OWNER: max + REPO: audio_splitter + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Log in to Gitea Container Registry + run: | + echo "${{ secrets.CI_PUSHER_GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin + + - name: Build Docker image + run: | + docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:${{ github.sha }} . + docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest + + - name: Push Docker image + run: | + docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:${{ github.sha }} + docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest -- 2.52.0 From 26fb4fb3f4da9c4e8e65750dba20da8b885092b6 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 19:17:36 +0500 Subject: [PATCH 03/12] Test CI/CD job was removed. Image building job was updated to build web version of the app --- .gitea/workflows/build_image.yaml | 22 ++++++++++++++++------ .gitea/workflows/ci_cd_test.yaml | 19 ------------------- 2 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 .gitea/workflows/ci_cd_test.yaml diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index b731b29..7a3aaca 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -20,12 +20,22 @@ jobs: run: | echo "${{ secrets.CI_PUSHER_GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin - - name: Build Docker image + - name: Build backend image run: | - docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:${{ github.sha }} . - docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest + docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} web/backend + docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest - - name: Push Docker image + - name: Push backend image run: | - docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:${{ github.sha }} - docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest + docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} + docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest + + - name: Build frontend image + run: | + docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} web/frontend + docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest + + - name: Push frontend image + run: | + docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} + docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest diff --git a/.gitea/workflows/ci_cd_test.yaml b/.gitea/workflows/ci_cd_test.yaml deleted file mode 100644 index c537cc6..0000000 --- a/.gitea/workflows/ci_cd_test.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." -- 2.52.0 From 3a326859def3a478621a311047e8d6c53e14e2ce Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 19:50:41 +0500 Subject: [PATCH 04/12] Building image action fixed to use correct Dockerfile and build context --- .gitea/workflows/build_image.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index 7a3aaca..278c611 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -22,7 +22,7 @@ jobs: - name: Build backend image run: | - docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} web/backend + docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} -f ./web/backend/Dockerfile . docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest - name: Push backend image @@ -30,12 +30,20 @@ jobs: docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest + - name: Trigger the webhook on the deployment server for backend + run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter-backend" + + + - name: Build frontend image run: | - docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} web/frontend + docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} -f ./web/frontend/Dockerfile . docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest - name: Push frontend image run: | docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest + + - name: Trigger the webhook on the deployment server for frontend + run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter-frontend" -- 2.52.0 From e28bcc27fc56ddd148eead2177fe2a3047949206 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 20:12:41 +0500 Subject: [PATCH 05/12] fixes in the build image action --- .gitea/workflows/build_image.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index 278c611..3d94f5e 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -23,7 +23,7 @@ jobs: - name: Build backend image run: | docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} -f ./web/backend/Dockerfile . - docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest + docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest - name: Push backend image run: | @@ -38,7 +38,7 @@ jobs: - name: Build frontend image run: | docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} -f ./web/frontend/Dockerfile . - docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}:latest + docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest - name: Push frontend image run: | -- 2.52.0 From e802b684ffe01d3dcc986245a18ba91b3d459b77 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 20:18:11 +0500 Subject: [PATCH 06/12] Docker build context fixed in frontend building job --- .gitea/workflows/build_image.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index 3d94f5e..48656fe 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -37,7 +37,7 @@ jobs: - name: Build frontend image run: | - docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} -f ./web/frontend/Dockerfile . + docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} -f ./web/frontend/Dockerfile ./web/frontend docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest - name: Push frontend image -- 2.52.0 From b6deed78c85401352dd773b4b949dad321eeca63 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 20:41:21 +0500 Subject: [PATCH 07/12] Building image action builds both images first, only then notifies the deployment server. Docker compose production file added --- .gitea/workflows/build_image.yaml | 20 +++++++++++++++----- docker-compose-prod.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 docker-compose-prod.yaml diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index 48656fe..ecf1242 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -10,7 +10,7 @@ env: REPO: audio_splitter jobs: - build-and-push: + build-and-push-backend: runs-on: ubuntu-latest steps: - name: Checkout code @@ -30,10 +30,16 @@ jobs: docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest - - name: Trigger the webhook on the deployment server for backend - run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter-backend" + build-and-push-frontend: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Log in to Gitea Container Registry + run: | + echo "${{ secrets.CI_PUSHER_GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin - name: Build frontend image run: | @@ -45,5 +51,9 @@ jobs: docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest - - name: Trigger the webhook on the deployment server for frontend - run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter-frontend" + + notify-deployment-server: + runs-on: ubuntu-latest + steps: + - name: Trigger the webhook on the deployment server to start pulling the images + run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter" diff --git a/docker-compose-prod.yaml b/docker-compose-prod.yaml new file mode 100644 index 0000000..9a4bc84 --- /dev/null +++ b/docker-compose-prod.yaml @@ -0,0 +1,25 @@ +services: + backend: + image: git.vmn.su/max/audio_splitter_backend:latest + ports: + - "8000:8000" + volumes: + - /tmp/audio_splitter_web:/tmp/audio_splitter_web # Bind mount + environment: + - PYTHONUNBUFFERED=1 + - DEBUG=1 + restart: unless-stopped + + frontend: + image: git.vmn.su/max/audio_splitter_frontend:latest + ports: + - "5173:80" + volumes: + - ./web/frontend:/app + - /app/node_modules + environment: + - BACKEND_URL=http://backend:8000 + - VITE_BACKEND_URL=http://backend:8000 + depends_on: + - backend + restart: unless-stopped -- 2.52.0 From e0490c5f410c2c3c733950118018ec2305cd08d1 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 21:46:48 +0500 Subject: [PATCH 08/12] .env.example is committed to the repo from now on. .env is used as a development file and ignored --- .env.example | 8 ++++++++ .gitignore | 1 + 2 files changed, 9 insertions(+) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..d2fb8ce --- /dev/null +++ b/.env.example @@ -0,0 +1,8 @@ +# Backend +DEBUG=0 +MAX_UPLOAD_SIZE_MB=500 +TEMP_DIR=/tmp/audio_splitter_web +CLEANUP_AFTER_SECONDS=3600 + +# Frontend (development) +VITE_BACKEND_URL=http://localhost:8000 diff --git a/.gitignore b/.gitignore index fdf025f..12cd3a5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ test_data/ venv/ web/frontend/node_modules TODO.md +.env -- 2.52.0 From fb9413e6f81017d52e06566e4cc3de681c2e811b Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 21:50:06 +0500 Subject: [PATCH 09/12] .env is untracked now --- .env | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .env diff --git a/.env b/.env deleted file mode 100644 index d2fb8ce..0000000 --- a/.env +++ /dev/null @@ -1,8 +0,0 @@ -# Backend -DEBUG=0 -MAX_UPLOAD_SIZE_MB=500 -TEMP_DIR=/tmp/audio_splitter_web -CLEANUP_AFTER_SECONDS=3600 - -# Frontend (development) -VITE_BACKEND_URL=http://localhost:8000 -- 2.52.0 From d1a166a0f16502e040a1bcbcbee548f2c57c14bc Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Wed, 5 Aug 2026 08:52:45 +0500 Subject: [PATCH 10/12] docker-compose-prod.yaml uses more variables from .env.example now --- .env.example | 3 +++ docker-compose-prod.yaml | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index d2fb8ce..4203597 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,9 @@ DEBUG=0 MAX_UPLOAD_SIZE_MB=500 TEMP_DIR=/tmp/audio_splitter_web CLEANUP_AFTER_SECONDS=3600 +BACKEND_DATA_VOLUME=/tmp/audio_splitter_web +BACKEND_PORT=8000 # Frontend (development) VITE_BACKEND_URL=http://localhost:8000 +FRONTEND_PORT=5173 diff --git a/docker-compose-prod.yaml b/docker-compose-prod.yaml index 9a4bc84..8041bcc 100644 --- a/docker-compose-prod.yaml +++ b/docker-compose-prod.yaml @@ -2,9 +2,9 @@ services: backend: image: git.vmn.su/max/audio_splitter_backend:latest ports: - - "8000:8000" + - "${BACKEND_PORT}:8000" volumes: - - /tmp/audio_splitter_web:/tmp/audio_splitter_web # Bind mount + - "${BACKEND_DATA_VOLUME}:/tmp/audio_splitter_web" environment: - PYTHONUNBUFFERED=1 - DEBUG=1 @@ -13,13 +13,16 @@ services: frontend: image: git.vmn.su/max/audio_splitter_frontend:latest ports: - - "5173:80" + - "${FRONTEND_PORT}:80" volumes: - ./web/frontend:/app - - /app/node_modules + - node_modules:/app/node_modules environment: - BACKEND_URL=http://backend:8000 - VITE_BACKEND_URL=http://backend:8000 depends_on: - backend restart: unless-stopped + +volumes: + node_modules: -- 2.52.0 From a028b875fbb6ea30fa289c534d4e7a5ca431495c Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Wed, 5 Aug 2026 09:07:00 +0500 Subject: [PATCH 11/12] building image actions is triggered only if a pull request has been merged into main --- .gitea/workflows/build_image.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index ecf1242..7e9c660 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -1,8 +1,9 @@ name: Build and Push Docker Image on: - push: - branches: [ "ci-cd" ] + pull_request: + types: [closed] + branches: [ main ] env: REGISTRY: git.vmn.su @@ -11,6 +12,7 @@ env: jobs: build-and-push-backend: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: Checkout code @@ -32,6 +34,7 @@ jobs: build-and-push-frontend: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: Checkout code @@ -53,6 +56,7 @@ jobs: notify-deployment-server: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - name: Trigger the webhook on the deployment server to start pulling the images -- 2.52.0 From 7f2b82aae04ed15eef5423b46bec7d3f0ffb3f38 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Wed, 5 Aug 2026 09:52:23 +0500 Subject: [PATCH 12/12] .env.example is improved, comments added. docker-compose-prod.yaml is replaced with docker-compose.yaml, development version is docker-compose.override.yaml now --- .env.example | 21 +++++++++++++++++--- docker-compose-prod.yaml | 28 --------------------------- docker-compose.override.yaml | 37 ++++++++++++++++++++++++++++++++++++ docker-compose.yaml | 24 ++++++++--------------- 4 files changed, 63 insertions(+), 47 deletions(-) delete mode 100644 docker-compose-prod.yaml create mode 100644 docker-compose.override.yaml diff --git a/.env.example b/.env.example index 4203597..95739ea 100644 --- a/.env.example +++ b/.env.example @@ -1,11 +1,26 @@ +# ------------------------------------------------------------------------------ +# Production Environment Variables +# ------------------------------------------------------------------------------ + # Backend DEBUG=0 MAX_UPLOAD_SIZE_MB=500 -TEMP_DIR=/tmp/audio_splitter_web CLEANUP_AFTER_SECONDS=3600 -BACKEND_DATA_VOLUME=/tmp/audio_splitter_web + +# Backend data directory (bind mount) +# This directory will store all temporary files during splitting. +# It can get large (audio files), so place it on a partition with enough space. +BACKEND_DATA_DIR=/var/lib/audio_splitter_data + +# Ports BACKEND_PORT=8000 +FRONTEND_PORT=5173 + +# ------------------------------------------------------------------------------ +# Development Overrides (docker-compose.override.yaml) +# ------------------------------------------------------------------------------ +# These are only used when docker-compose.override.yaml is present. +# They override the production settings for local development. # Frontend (development) VITE_BACKEND_URL=http://localhost:8000 -FRONTEND_PORT=5173 diff --git a/docker-compose-prod.yaml b/docker-compose-prod.yaml deleted file mode 100644 index 8041bcc..0000000 --- a/docker-compose-prod.yaml +++ /dev/null @@ -1,28 +0,0 @@ -services: - backend: - image: git.vmn.su/max/audio_splitter_backend:latest - ports: - - "${BACKEND_PORT}:8000" - volumes: - - "${BACKEND_DATA_VOLUME}:/tmp/audio_splitter_web" - environment: - - PYTHONUNBUFFERED=1 - - DEBUG=1 - restart: unless-stopped - - frontend: - image: git.vmn.su/max/audio_splitter_frontend:latest - ports: - - "${FRONTEND_PORT}:80" - volumes: - - ./web/frontend:/app - - node_modules:/app/node_modules - environment: - - BACKEND_URL=http://backend:8000 - - VITE_BACKEND_URL=http://backend:8000 - depends_on: - - backend - restart: unless-stopped - -volumes: - node_modules: diff --git a/docker-compose.override.yaml b/docker-compose.override.yaml new file mode 100644 index 0000000..4c9b1fa --- /dev/null +++ b/docker-compose.override.yaml @@ -0,0 +1,37 @@ +services: + backend: + build: + context: . + dockerfile: web/backend/Dockerfile + volumes: + # Bind mount for source code (hot-reload for Python) + - ./web/backend:/app/backend + - ./audio_splitter:/app/audio_splitter + - ./setup.py:/app/setup.py + - ./pyproject.toml:/app/pyproject.toml + # Development data directory (overrides production) + - "./dev_data:/tmp/audio_splitter_web" + environment: + - DEBUG=1 + - PYTHONUNBUFFERED=1 + ports: + - "8000:8000" + + frontend: + build: + context: ./web/frontend + # Use the same Dockerfile, but override CMD for development + dockerfile: Dockerfile + command: ["npm", "run", "dev", "--", "--host", "0.0.0.0"] + volumes: + # Bind mount for source code (hot-reload for Vite) + - ./web/frontend:/app + - node_modules:/app/node_modules + environment: + - BACKEND_URL=http://backend:8000 + - VITE_BACKEND_URL=http://backend:8000 + ports: + - "5173:5173" + +volumes: + node_modules: diff --git a/docker-compose.yaml b/docker-compose.yaml index bd7a218..48151a8 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,29 +1,21 @@ services: backend: - build: - context: . - dockerfile: web/backend/Dockerfile + image: git.vmn.su/max/audio_splitter_backend:latest ports: - - "8000:8000" + - "${BACKEND_PORT:-8000}:8000" volumes: - - /tmp/audio_splitter_web:/tmp/audio_splitter_web # Bind mount + # Bind mount for persistent data storage. + # Set BACKEND_DATA_DIR in .env to point to your data directory. + - "${BACKEND_DATA_DIR:-/var/lib/audio_splitter_data}:/tmp/audio_splitter_web" environment: - PYTHONUNBUFFERED=1 - - DEBUG=1 + - DEBUG=${DEBUG:-0} restart: unless-stopped frontend: - build: - context: ./web/frontend - dockerfile: Dockerfile + image: git.vmn.su/max/audio_splitter_frontend:latest ports: - - "5173:80" - volumes: - - ./web/frontend:/app - - /app/node_modules - environment: - - BACKEND_URL=http://backend:8000 - - VITE_BACKEND_URL=http://backend:8000 + - "${FRONTEND_PORT:-5173}:80" depends_on: - backend restart: unless-stopped -- 2.52.0