mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-13 16:22:59 +10:00
ci(docker): include traefik routing and proxy to ensure server connections pass in local
This commit is contained in:
@ -11,6 +11,18 @@ services:
|
|||||||
- ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql
|
- ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
traefik:
|
||||||
|
image: traefik
|
||||||
|
container_name: traefik
|
||||||
|
command:
|
||||||
|
- --providers.docker=true
|
||||||
|
- --providers.docker.exposedbydefault=false
|
||||||
|
- --entrypoints.web.address=:80
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
|
||||||
server:
|
server:
|
||||||
# Production
|
# Production
|
||||||
# image: amruthpillai/reactive-resume:server-latest
|
# image: amruthpillai/reactive-resume:server-latest
|
||||||
@ -22,12 +34,18 @@ services:
|
|||||||
container_name: server
|
container_name: server
|
||||||
env_file: .env
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- PUBLIC_URL=http://client:3000
|
- PUBLIC_URL=http://localhost
|
||||||
- POSTGRES_HOST=postgres
|
- POSTGRES_HOST=postgres
|
||||||
ports:
|
|
||||||
- 3100:3100
|
|
||||||
depends_on:
|
depends_on:
|
||||||
|
- traefik
|
||||||
- postgres
|
- postgres
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.server.entrypoints=web
|
||||||
|
- traefik.http.routers.server.rule=Host(`localhost`) && PathPrefix(`/api/`)
|
||||||
|
- traefik.http.routers.server.middlewares=server-stripprefix
|
||||||
|
- traefik.http.middlewares.server-stripprefix.stripprefix.prefixes=/api
|
||||||
|
- traefik.http.middlewares.server-stripprefix.stripprefix.forceslash=true
|
||||||
|
|
||||||
client:
|
client:
|
||||||
# Production
|
# Production
|
||||||
@ -40,11 +58,14 @@ services:
|
|||||||
container_name: client
|
container_name: client
|
||||||
env_file: .env
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
- PUBLIC_SERVER_URL=http://server:3100
|
- PUBLIC_SERVER_URL=http://localhost/api
|
||||||
ports:
|
|
||||||
- 3000:3000
|
|
||||||
depends_on:
|
depends_on:
|
||||||
|
- traefik
|
||||||
- server
|
- server
|
||||||
|
labels:
|
||||||
|
- traefik.enable=true
|
||||||
|
- traefik.http.routers.client.rule=Host(`localhost`)
|
||||||
|
- traefik.http.routers.client.entrypoints=web
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pgdata:
|
pgdata:
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export class HealthController {
|
|||||||
return this.health.check([
|
return this.health.check([
|
||||||
() => this.db.pingCheck('database'),
|
() => this.db.pingCheck('database'),
|
||||||
() => this.http.pingCheck('app', 'https://rxresu.me'),
|
() => this.http.pingCheck('app', 'https://rxresu.me'),
|
||||||
() => this.http.pingCheck('docs', 'https://beta.rxresu.me'),
|
() => this.http.pingCheck('docs', 'https://docs.rxresu.me'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user