diff --git a/.env b/.env index d2f8d852..131b17e4 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -teamname="asw2324_0" \ No newline at end of file +teamname="wiq_0" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6feea162..08a91806 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -125,4 +125,4 @@ jobs: wget https://raw.githubusercontent.com/arquisoft/wiq_0/master/docker-compose.yml wget https://raw.githubusercontent.com/arquisoft/wiq_0/master/docker-compose-deploy.override.yml docker compose down - docker compose -f docker-compose.yml -f docker-compose-deploy.override.yml up -d + docker compose --profile prod up -d diff --git a/README.md b/README.md index cc5e628d..62fe7191 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ git clone https://github.com/Arquisoft/wiq_0.git and launch it with docker compose: ```sh -docker compose -f docker-compose.yml -f docker-compose-dev.override.yml up --build +docker compose --profile dev up --build ``` ### Starting Component by component @@ -102,7 +102,7 @@ deploy: command: | wget https://raw.githubusercontent.com/arquisoft/wiq_0/master/docker-compose-deploy.yml -O docker-compose.yml docker compose down --volumes - docker compose -f docker-compose.yml -f docker-compose-deploy.override.yml up -d + docker compose --profile prod up -d ``` This action uses three secrets that must be configured in the repository: diff --git a/docker-compose-deploy.override.yml b/docker-compose-deploy.override.yml deleted file mode 100644 index 0dab2744..00000000 --- a/docker-compose-deploy.override.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: '3' -services: - mongodb: - ports: - - "27017:27017" - networks: - - mynetwork - - authservice: - ports: - - "8002:8002" - networks: - - mynetwork - environment: - MONGODB_URI: mongodb://mongodb:27017/userdb - - userservice: - ports: - - "8001:8001" - networks: - - mynetwork - environment: - MONGODB_URI: mongodb://mongodb:27017/userdb - - gatewayservice: - ports: - - "8000:8000" - networks: - - mynetwork - environment: - AUTH_SERVICE_URL: http://authservice:8002 - USER_SERVICE_URL: http://userservice:8001 - - webapp: - ports: - - "3000:3000" - -networks: - mynetwork: - driver: bridge - diff --git a/docker-compose-dev.override.yml b/docker-compose-dev.override.yml deleted file mode 100644 index 4df99e0c..00000000 --- a/docker-compose-dev.override.yml +++ /dev/null @@ -1,81 +0,0 @@ -version: '3' -services: - mongodb: - image: mongo - ports: - - "27017:27017" - networks: - - mynetwork - volumes: - - mongodb_data:/data/db - - authservice: - build: ./users/authservice - ports: - - "8002:8002" - networks: - - mynetwork - environment: - MONGODB_URI: mongodb://mongodb:27017/userdb - - userservice: - build: ./users/userservice - ports: - - "8001:8001" - networks: - - mynetwork - environment: - MONGODB_URI: mongodb://mongodb:27017/userdb - - gatewayservice: - build: ./gatewayservice - ports: - - "8000:8000" - networks: - - mynetwork - environment: - AUTH_SERVICE_URL: http://authservice:8002 - USER_SERVICE_URL: http://userservice:8001 - - webapp: - build: ./webapp - ports: - - "3000:3000" - - prometheus: - image: prom/prometheus - networks: - - mynetwork - volumes: - - ./gatewayservice/monitoring/prometheus:/etc/prometheus - - prometheus_data:/prometheus - ports: - - "9090:9090" - depends_on: - - gatewayservice - - grafana: - image: grafana/grafana - networks: - - mynetwork - volumes: - - grafana_data:/var/lib/grafana - - ./gatewayservice/monitoring/grafana/provisioning:/etc/grafana/provisioning - environment: - - GF_SERVER_HTTP_PORT=9091 - - GF_AUTH_DISABLE_LOGIN_FORM=true - - GF_AUTH_ANONYMOUS_ENABLED=true - - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin - ports: - - "9091:9091" - depends_on: - - prometheus - -networks: - mynetwork: - driver: bridge - -volumes: - mongodb_data: - prometheus_data: - grafana_data: diff --git a/docker-compose.yml b/docker-compose.yml index be03b81d..c105ed50 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,38 +3,108 @@ services: mongodb: container_name: mongodb-${teamname:-defaultASW} image: mongo + profiles: ["dev", "prod"] volumes: - mongodb_data:/data/db + ports: + - "27017:27017" + networks: + - mynetwork authservice: container_name: authservice-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_0/authservice:latest + profiles: ["dev", "prod"] build: ./users/authservice depends_on: - mongodb + ports: + - "8002:8002" + networks: + - mynetwork + environment: + MONGODB_URI: mongodb://mongodb:27017/userdb userservice: container_name: userservice-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_0/userservice:latest + profiles: ["dev", "prod"] build: ./users/userservice depends_on: - mongodb + ports: + - "8001:8001" + networks: + - mynetwork + environment: + MONGODB_URI: mongodb://mongodb:27017/userdb gatewayservice: container_name: gatewayservice-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_0/gatewayservice:latest + profiles: ["dev", "prod"] build: ./gatewayservice depends_on: - mongodb - userservice - authservice + ports: + - "8000:8000" + networks: + - mynetwork + environment: + AUTH_SERVICE_URL: http://authservice:8002 + USER_SERVICE_URL: http://userservice:8001 webapp: container_name: webapp-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_0/webapp:latest + profiles: ["dev", "prod"] build: ./webapp depends_on: - - gatewayservice + - gatewayservice + ports: + - "3000:3000" + + prometheus: + image: prom/prometheus + container_name: prometheus-${teamname:-defaultASW} + profiles: ["dev"] + networks: + - mynetwork + volumes: + - ./gatewayservice/monitoring/prometheus:/etc/prometheus + - prometheus_data:/prometheus + ports: + - "9090:9090" + depends_on: + - gatewayservice + + grafana: + image: grafana/grafana + container_name: grafana-${teamname:-defaultASW} + profiles: ["dev"] + networks: + - mynetwork + volumes: + - grafana_data:/var/lib/grafana + - ./gatewayservice/monitoring/grafana/provisioning:/etc/grafana/provisioning + environment: + - GF_SERVER_HTTP_PORT=9091 + - GF_AUTH_DISABLE_LOGIN_FORM=true + - GF_AUTH_ANONYMOUS_ENABLED=true + - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin + ports: + - "9091:9091" + depends_on: + - prometheus + volumes: mongodb_data: + prometheus_data: + grafana_data: + +networks: + mynetwork: + driver: bridge