Skip to content

Commit

Permalink
updating docker compose and actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pglez82 committed Jan 22, 2024
1 parent 15e75cb commit b7a0279
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 129 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Build
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ jobs:
wget https://raw.githubusercontent.com/pglez82/asw2324_0/master/docker-compose.yml
wget https://raw.githubusercontent.com/pglez82/asw2324_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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Both the user and auth service share a Mongo database that is accessed with mong
The fastest way for launching this sample project is using docker. Just clone the project:
```git clone [email protected]:pglez82/asw2324_0.git```
and launch it with docker compose:
```docker compose -f docker-compose.yml -f docker-compose-dev.override.yml up --build```
```docker compose --profile dev up --build```

### Component by component start
First, start the database. Either install and run Mongo or run it using docker:
Expand Down
41 changes: 0 additions & 41 deletions docker-compose-deploy.override.yml

This file was deleted.

81 changes: 0 additions & 81 deletions docker-compose-dev.override.yml

This file was deleted.

80 changes: 75 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/pglez82/asw2324_0/authservice:latest
image: ghcr.io/arquisoft/asw2324_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/pglez82/asw2324_0/userservice:latest
image: ghcr.io/arquisoft/asw2324_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/pglez82/asw2324_0/gatewayservice:latest
image: ghcr.io/arquisoft/asw2324_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/pglez82/asw2324_0/webapp:latest
image: ghcr.io/arquisoft/asw2324_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

0 comments on commit b7a0279

Please sign in to comment.