diff --git a/.github/workflows/infrastructure.yaml b/.github/workflows/infrastructure.yaml index ac6fd2e5..e27cce41 100644 --- a/.github/workflows/infrastructure.yaml +++ b/.github/workflows/infrastructure.yaml @@ -130,7 +130,6 @@ jobs: sudo mkdir -p $VOLUME_PATH/mongodb/db sudo mkdir -p $VOLUME_PATH/mongodb/configdb sudo mkdir -p $VOLUME_PATH/nats - sudo chown -R ${{ secrets.EC2_SSH_USER }}:${{ secrets.EC2_SSH_USER }} $VOLUME_PATH/* EOF # Copy files @@ -183,12 +182,12 @@ jobs: # Run Docker Compose cd /opt/deployment/ - docker stack deploy -c compose.mongodb.yaml mongodb --detach=true - docker stack deploy -c compose.mongodb_dashboard.yaml mongodb_dashboard --detach=true - docker stack deploy -c compose.nats.yaml nats --detach=true - docker stack deploy -c compose.docker.yaml docker --detach=true - docker stack deploy -c compose.docker_dashboard.yaml docker_dashboard --detach=true - docker stack deploy -c compose.backend.yaml backend --detach=true - docker stack deploy -c compose.frontend.yaml frontend --detach=true - docker stack deploy -c compose.proxy.yaml proxy --detach=true + docker compose -f compose.mongodb.yaml --project-name mongodb up --pull always --detach + docker compose -f compose.mongodb_dashboard.yaml --project-name mongodb_dashboard up --pull always --detach + docker compose -f compose.nats.yaml --project-name nats up --pull always --detach + docker compose -f compose.docker.yaml --project-name docker up --pull always --detach + docker compose -f compose.docker_dashboard.yaml --project-name docker_dashboard up --pull always --detach + docker compose -f compose.app.yaml --project-name app up --pull always --detach + docker compose -f compose.frontend.yaml --project-name frontend up --pull always --detach + docker compose -f compose.proxy.yaml --project-name proxy up --pull always --detach EOF diff --git a/infrastructure/Makefile b/infrastructure/Makefile index 6221ed95..40269854 100644 --- a/infrastructure/Makefile +++ b/infrastructure/Makefile @@ -74,21 +74,21 @@ ssh: ssh -i "ssh-private-key.pem" ${EC2_SSH_ENDPOINT} up: - docker stack deploy -c compose.mongodb.yaml mongodb --detach=false - docker stack deploy -c compose.mongodb_dashboard.yaml mongodb_dashboard --detach=false - docker stack deploy -c compose.nats.yaml nats --detach=false - docker stack deploy -c compose.docker.yaml docker --detach=false - docker stack deploy -c compose.docker_dashboard.yaml docker_dashboard --detach=false - docker stack deploy -c compose.backend.yaml backend --detach=false - docker stack deploy -c compose.frontend.yaml frontend --detach=false - docker stack deploy -c compose.proxy.yaml proxy --detach=false + docker compose -f compose.mongodb.yaml --project-name mongodb up --pull always --detach + docker compose -f compose.mongodb_dashboard.yaml --project-name mongodb_dashboard up --pull always --detach + docker compose -f compose.nats.yaml --project-name nats up --pull always --detach + docker compose -f compose.docker.yaml --project-name docker up --pull always --detach + docker compose -f compose.docker_dashboard.yaml --project-name docker_dashboard up --pull always --detach + docker compose -f compose.app.yaml --project-name app up --pull always --detach + docker compose -f compose.frontend.yaml --project-name frontend up --pull always --detach + docker compose -f compose.proxy.yaml --project-name proxy up --pull always --detach down: - docker stack rm proxy - docker stack rm frontend - docker stack rm backend - docker stack rm docker_dashboard - docker stack rm docker - docker stack rm nats - docker stack rm mongodb_dashboard - docker stack rm mongodb + docker compose -f compose.frontend.yaml --project-name frontend down --volumes --remove-orphans + docker compose -f compose.app.yaml --project-name app down --volumes --remove-orphans + docker compose -f compose.proxy.yaml --project-name proxy down --volumes --remove-orphans + docker compose -f compose.nats.yaml --project-name nats down --volumes --remove-orphans + docker compose -f compose.docker_dashboard.yaml --project-name docker_dashboard down --volumes --remove-orphans + docker compose -f compose.docker.yaml --project-name docker down --volumes --remove-orphans + docker compose -f compose.mongodb_dashboard.yaml --project-name mongodb_dashboard down --volumes --remove-orphans + docker compose -f compose.mongodb.yaml --project-name mongodb down --volumes --remove-orphans diff --git a/infrastructure/compose.app.yaml b/infrastructure/compose.app.yaml index c950acf5..36c4cba0 100644 --- a/infrastructure/compose.app.yaml +++ b/infrastructure/compose.app.yaml @@ -37,7 +37,6 @@ services: networks: app: name: app - driver: overlay mongodb: name: mongodb external: true diff --git a/infrastructure/compose.docker.yaml b/infrastructure/compose.docker.yaml index f66b8b1b..0b09267a 100644 --- a/infrastructure/compose.docker.yaml +++ b/infrastructure/compose.docker.yaml @@ -12,10 +12,10 @@ services: delay: 5s max_attempts: 3 runtime: sysbox-runc + # privileged: true # To test localy: enable this line and disable runtime environment: DOCKER_TLS_CERTDIR: "" # disable certs networks: docker: name: docker - driver: overlay diff --git a/infrastructure/compose.docker_dashboard.yaml b/infrastructure/compose.docker_dashboard.yaml index 7a4b84fa..ec875938 100644 --- a/infrastructure/compose.docker_dashboard.yaml +++ b/infrastructure/compose.docker_dashboard.yaml @@ -18,7 +18,6 @@ services: networks: docker_dashboard: name: docker_dashboard - driver: overlay docker: name: docker external: true diff --git a/infrastructure/compose.frontend.yaml b/infrastructure/compose.frontend.yaml index d06c2081..35f2c02a 100644 --- a/infrastructure/compose.frontend.yaml +++ b/infrastructure/compose.frontend.yaml @@ -20,7 +20,6 @@ services: networks: frontend: name: frontend - driver: overlay app: name: app external: true diff --git a/infrastructure/compose.mongodb.yaml b/infrastructure/compose.mongodb.yaml index 704d61be..55389b26 100644 --- a/infrastructure/compose.mongodb.yaml +++ b/infrastructure/compose.mongodb.yaml @@ -21,4 +21,3 @@ services: networks: mongodb: name: mongodb - driver: overlay diff --git a/infrastructure/compose.mongodb_dashboard.yaml b/infrastructure/compose.mongodb_dashboard.yaml index bbc9a2d0..3076e8dc 100644 --- a/infrastructure/compose.mongodb_dashboard.yaml +++ b/infrastructure/compose.mongodb_dashboard.yaml @@ -12,8 +12,6 @@ services: condition: on-failure delay: 5s max_attempts: 3 - depends_on: - - mongodb environment: ME_CONFIG_BASICAUTH_USERNAME: ${DASHBOARD_MONGO_USERNAME} ME_CONFIG_BASICAUTH_PASSWORD: ${DASHBOARD_MONGO_PASSWORD} @@ -22,7 +20,6 @@ services: networks: mongodb_dashboard: name: mongodb_dashboard - driver: overlay mongodb: name: mongodb external: true diff --git a/infrastructure/compose.nats.yaml b/infrastructure/compose.nats.yaml index da55a2dc..a9bb63e9 100644 --- a/infrastructure/compose.nats.yaml +++ b/infrastructure/compose.nats.yaml @@ -12,10 +12,9 @@ services: delay: 5s max_attempts: 3 volumes: - - ${VOLUME_PATH}/nats:/jetstream + - ${VOLUME_PATH}/nats:/data command: ["--jetstream", "--http_port", "8222", "--port", "4222", "--store_dir", "/data"] networks: nats: name: nats - driver: overlay diff --git a/infrastructure/compose.proxy.yaml b/infrastructure/compose.proxy.yaml index b7791a27..94957c5f 100644 --- a/infrastructure/compose.proxy.yaml +++ b/infrastructure/compose.proxy.yaml @@ -21,7 +21,6 @@ services: networks: proxy: name: proxy - driver: overlay frontend: name: frontend external: true