Skip to content

Commit

Permalink
UserService change
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiollende committed Mar 14, 2024
1 parent b191adb commit 19bc338
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 42 deletions.
20 changes: 2 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,22 +40,6 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: wikidata_service
docker-push-authservice:
name: Push auth service Docker Image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: arquisoft/wiq_en3a/authservice
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/authservice
docker-push-userservice:
name: Push user service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand All @@ -71,7 +55,7 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
workdir: users/userservice
workdir: users
docker-push-gatewayservice:
name: Push gateway service Docker Image to GitHub Packages
runs-on: ubuntu-latest
Expand All @@ -91,7 +75,7 @@ jobs:
deploy:
name: Deploy over SSH
runs-on: ubuntu-latest
needs: [docker-push-userservice,docker-push-authservice,docker-push-gatewayservice,docker-push-webapp, docker-push-wikidata-service]
needs: [docker-push-userservice,docker-push-gatewayservice,docker-push-webapp, docker-push-wikidata-service]
steps:
- name: Deploy over SSH
uses: fifsky/ssh-action@master
Expand Down
22 changes: 3 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,15 @@ services:
networks:
- mynetwork

authservice:
container_name: authservice-${teamname:-defaultASW}
image: ghcr.io/arquisoft/wiq_en3a/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_en3a/userservice:latest
profiles: ["dev", "prod"]
build: ./users/userservice
build: ./users
depends_on:
- mongodb
ports:
- "8001:8001"
- "8002:8002"
networks:
- mynetwork
environment:
Expand All @@ -57,15 +43,13 @@ services:
depends_on:
- mongodb
- userservice
- authservice
- wikidata_service
ports:
- "8000:8000"
networks:
- mynetwork
environment:
AUTH_SERVICE_URL: http://authservice:8002
USER_SERVICE_URL: http://userservice:8001
USER_SERVICE_URL: http://userservice:8002
WIKIDATA_SERVICE_URL: http://wikidata_service:7259


Expand Down
5 changes: 2 additions & 3 deletions gatewayservice/gateway-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ const promBundle = require('express-prom-bundle');
const app = express();
const port = 8000;

const authServiceUrl = process.env.AUTH_SERVICE_URL || 'http://localhost:8002';
const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8001';
const userServiceUrl = process.env.USER_SERVICE_URL || 'http://localhost:8002';
const wikidataServiceUrl = process.env.WIKIDATA_SERVICE_URL || 'http://localhost:7259';

app.use(cors());
Expand All @@ -25,7 +24,7 @@ app.get('/health', (_req, res) => {
app.post('/login', async (req, res) => {
try {
// Forward the login request to the authentication service
const authResponse = await axios.post(authServiceUrl + '/auth/login', req.body);
const authResponse = await axios.post(userServiceUrl + '/auth/login', req.body);
res.json(authResponse.data);
} catch (error) {
res.status(error.response.status).json({ error: error.response.data.error });
Expand Down
2 changes: 0 additions & 2 deletions users/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ app.use('/auth', authRoutes);
app.use('/user', userRoutes);




// Start the server
const server = app.listen(port, () => {
console.log(`Auth Service listening at http://localhost:${port}`);
Expand Down

0 comments on commit 19bc338

Please sign in to comment.