Skip to content
Open
Prev Previous commit
Next Next commit
[traefik] publish services using a reverse-proxy
  • Loading branch information
mgrzybek committed Sep 20, 2019
commit 2ade8d9d8f356b36a37f5cae001a3e1493ce8319
32 changes: 23 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@ volumes:
jenkins-data:

services:
traefik:
image: traefik:montdor
restart: always
command: --accesslog --api --api.insecure=true --log --providers.docker=true --providers.docker.exposedbydefault=false
ports:
- "80:80"
- "443:443"
- "8080:8080"
networks:
- prodnetwork
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
nexus:
build: ./nexus
restart: always
ports:
- "18081:8081"
networks:
- prodnetwork
volumes:
- nexus-data:/nexus-data
labels:
- "traefik.enable=true"
- "traefik.http.routers.nexus.rule=Host(`localhost`) && PathPrefix(`/nexus/`)"
jenkins:
build: ./jenkins
restart: always
ports:
- "18080:8080"
networks:
- prodnetwork
volumes:
Expand All @@ -36,22 +47,21 @@ services:
- NEXUS_PORT=8081
- SONAR_PORT=9000
- SONAR_DB_PORT=5432
- JENKINS_OPTS=--prefix=/jenkins/
labels:
- "traefik.enable=true"
- "traefik.http.routers.jenkins.rule=Host(`localhost`) && PathPrefix(`/jenkins`)"
sonardb:
networks:
- prodnetwork
restart: always
image: postgres:9.6
ports:
- "5432:5432"
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
sonar:
image: sonarqube
restart: always
ports:
- "19000:9000"
- "19092:9092"
networks:
- prodnetwork
depends_on:
Expand All @@ -60,6 +70,10 @@ services:
- SONARQUBE_JDBC_URL=jdbc:postgresql://sonardb:5432/sonar
- SONARQUBE_JDBC_USERNAME=sonar
- SONARQUBE_JDBC_PASSWORD=sonar
- sonar.web.context=/sonar
labels:
- "traefik.enable=true"
- "traefik.http.routers.sonar.rule=Host(`localhost`) && PathPrefix(`/sonar/`)"

##########################################################################################
# DISABLED: GitLab takes too much memory and CPU. Demo uses GitHub repositories instead.
Expand Down
2 changes: 1 addition & 1 deletion nexus/Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ EXPOSE 8081

WORKDIR /opt/sonatype/nexus

ENV CONTEXT_PATH /
ENV CONTEXT_PATH /nexus
ENV MAX_HEAP 768m
ENV MIN_HEAP 256m
ENV JAVA_OPTS -server -XX:MaxPermSize=192m -Djava.net.preferIPv4Stack=true
Expand Down