Skip to content

Commit

Permalink
fix: use diff docker compsoe file
Browse files Browse the repository at this point in the history
  • Loading branch information
nischalstha9 committed Jul 19, 2024
1 parent 1db6701 commit 07bee4a
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ jobs:
- name: Deploy to VM
run: |
docker compose --file docker-compose.yml --env-file .env pull
docker compose --file docker-compose.yml --env-file .env up \
source .env
docker compose --file docker-compose.vm.yml --env-file .env pull
docker compose --file docker-compose.vm.yml --env-file .env up \
--detach --remove-orphans --force-recreate
env:
DOCKER_HOST: "ssh://${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}"
Expand Down
82 changes: 82 additions & 0 deletions docker-compose.vm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
version: "3"

services:
backend:
image: naxa/dronetm:${BACKEND_TARGET_OVERRIDE:-backend}
restart: always
depends_on:
- db
- minio
ports:
- ${BACKEND_WEB_APP_PORT:-8000}:8000
env_file: .env
networks:
- dtm-network

frontend:
image: naxa/dronetm:${FRONTEND_TARGET_OVERRIDE:-frontend}
depends_on:
- minio
env_file: .env
networks:
- dtm-network

db:
image: postgis/postgis:14-3.4-alpine
restart: always
volumes:
- ${PROJECT_DIR:-.}/DockerData/dtm_db_data:/var/lib/postgresql/data/
env_file: .env
networks:
- dtm-network
healthcheck:
test: pg_isready -U ${POSTGRES_USER:-dtm} -d ${POSTGRES_DB:-dtm_db}
start_period: 5s
interval: 10s
timeout: 5s
retries: 3

minio:
image: "docker.io/minio/minio:${MINIO_TAG:-RELEASE.2023-10-25T06-33-25Z}"
restart: always
command: server /export --console-address 0.0.0.0:9090 --address 0.0.0.0:9000
volumes:
- ${PROJECT_DIR:-.}/DockerData/minio_data:/export
environment:
MINIO_ROOT_USER: ${S3_ACCESS_KEY:-dtm_user}
MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY:-somelongpassword}
MINIO_CONSOLE_ADDRESS: ":9090"
ports:
- 9000:9000
- 9090:9090
networks:
- dtm-network

createbuckets:
image: "docker.io/minio/minio:${MINIO_TAG:-RELEASE.2023-10-25T06-33-25Z}"
entrypoint: >
/bin/sh -c " mc config host add minio http://minio:9000 \$S3_ACCESS_KEY \$S3_SECRET_KEY; mc mb minio/\$S3_BUCKET_NAME; mc anonymous set download minio/\$S3_BUCKET_NAME/publicuploads/; exit 0; "
env_file:
- .env
depends_on:
- minio
networks:
- dtm-network

migrations:
image: naxa/dronetm:${BACKEND_TARGET_OVERRIDE:-backend}
volumes:
- ${PROJECT_DIR:-.}/src/backend:/project/src/backend
depends_on:
- backend
- db
env_file:
- .env
networks:
- dtm-network
entrypoint: ["pdm", "run", "alembic", "upgrade", "head"]
restart: "no"

networks:
dtm-network:
name: dtm-network
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ services:
build:
context: .
dockerfile: src/backend/Dockerfile
container_name: dtm_migrations
volumes:
- ${PROJECT_DIR:-.}/src/backend:/project/src/backend
depends_on:
Expand Down

0 comments on commit 07bee4a

Please sign in to comment.