Created
December 16, 2021 17:16
-
-
Save rail/f17efdb538c2a5fe214555e4f5e697ac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Makefile b/Makefile | |
index de5c56d..bf5e627 100644 | |
--- a/Makefile | |
+++ b/Makefile | |
@@ -1,25 +1,25 @@ | |
# https://github.com/egregors/teamcity-docker-compose | |
# Team City | |
-COMPOSE_FILE=docker-compose.yml | |
+COMPOSE_FILE=docker-compose-nossl.yml | |
all: help # Show this message | |
# update & upgrade TC | |
update: stop down build uplog ## Update images | |
-up: acme uplog ## Up services | |
+up: uplog ## Up services | |
# up and show logs | |
uplog: # Up services and show logs | |
docker-compose -f $(COMPOSE_FILE) up -d && docker-compose -f $(COMPOSE_FILE) logs -f -t --tail=10 | |
stop: ## Stop services | |
docker-compose -f $(COMPOSE_FILE) stop | |
build: ## Build all images | |
docker-compose -f $(COMPOSE_FILE) build --pull --no-cache | |
down: ## Stop services and cleanup | |
docker-compose -f $(COMPOSE_FILE) down --rmi all | |
acme: ## Create folder and file for acme credentials | |
mkdir -p /opt/traefik && touch /opt/traefik/acme.json && chmod 600 /opt/traefik/acme.json | |
@@ -29,17 +29,17 @@ acme: ## Create folder and file for acme credentials | |
help: ## Show help message | |
@IFS=$$'\n' ; \ | |
help_lines=(`fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/:/'`); \ | |
printf "%s\n\n" "Usage: make [task]"; \ | |
printf "%-20s %s\n" "task" "help" ; \ | |
printf "%-20s %s\n" "------" "----" ; \ | |
for help_line in $${help_lines[@]}; do \ | |
IFS=$$':' ; \ | |
help_split=($$help_line) ; \ | |
help_command=`echo $${help_split[0]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ | |
help_info=`echo $${help_split[2]} | sed -e 's/^ *//' -e 's/ *$$//'` ; \ | |
printf '\033[36m'; \ | |
printf "%-20s %s" $$help_command ; \ | |
printf '\033[0m'; \ | |
printf "%s\n" $$help_info; \ | |
- done | |
\ No newline at end of file | |
+ done | |
diff --git a/docker-compose-nossl.yml b/docker-compose-nossl.yml | |
index a646d38..06e2fea 100644 | |
--- a/docker-compose-nossl.yml | |
+++ b/docker-compose-nossl.yml | |
@@ -1,27 +1,24 @@ | |
version: '3' | |
services: | |
server: | |
image: jetbrains/teamcity-server:latest | |
- networks: | |
- - web | |
- - default | |
volumes: | |
- - "/opt/teamcity/data:/data/teamcity_server/datadir" | |
- - "/opt/teamcity/logs:/opt/teamcity/logs" | |
+ - "./volumes/data:/data/teamcity_server/datadir" | |
+ - "./volumes/logs:/opt/teamcity/logs" | |
hostname: ${VIRTUAL_HOST} | |
ports: | |
- "8111" | |
depends_on: | |
- postgres | |
env_file: .env | |
labels: | |
- "traefik.enable=true" | |
- "traefik.backend=server" | |
# VIRTUAL_HOST for local case should be localhost | |
# if you wanna nossl version for non local case... no, you don't | |
- "traefik.frontend.rule=Host:localhost" | |
- "traefik.docker.network=web" | |
- "traefik.port=8111" | |
logging: | |
driver: json-file | |
@@ -34,53 +31,47 @@ services: | |
env_file: .env | |
# if you need docker inside the agent | |
# (http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/) | |
volumes: | |
- "/var/run/docker.sock:/var/run/docker.sock" | |
labels: | |
- "traefik.enable=false" | |
logging: | |
driver: json-file | |
options: | |
max-size: "10m" | |
max-file: "5" | |
postgres: | |
build: ./postgres | |
volumes: | |
- - "/opt/teamcity/pg_data:/var/lib/postgresql/data" | |
- - "/opt/teamcity/pg_backup:/backups" | |
+ - "./volumes/pg_data:/var/lib/postgresql/data" | |
+ - "./volumes/pg_backup:/backups" | |
env_file: .env | |
labels: | |
- "traefik.enable=false" | |
logging: | |
driver: json-file | |
options: | |
max-size: "10m" | |
max-file: "5" | |
traefik: | |
image: traefik:1.7-alpine | |
restart: on-failure | |
command: | |
- --logLevel=ERROR | |
- --docker | |
- --docker.watch=true | |
- --docker.exposedByDefault=false | |
- --docker.domain=docker.localhost | |
- --defaultEntryPoints=http | |
- --entryPoints=Name:http Address::80 | |
ports: | |
- "80:80" | |
- networks: | |
- - web | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
logging: | |
driver: json-file | |
options: | |
max-size: "10m" | |
max-file: "5" | |
- | |
-networks: | |
- web: | |
- external: true | |
diff --git a/docker-compose.yml b/docker-compose.yml | |
index 3d422d9..6c4cf60 100644 | |
--- a/docker-compose.yml | |
+++ b/docker-compose.yml | |
@@ -1,27 +1,27 @@ | |
version: '3' | |
services: | |
server: | |
image: jetbrains/teamcity-server:latest | |
networks: | |
- web | |
- default | |
volumes: | |
- - "/opt/teamcity/data:/data/teamcity_server/datadir" | |
- - "/opt/teamcity/logs:/opt/teamcity/logs" | |
+ - "volumes/data:/data/teamcity_server/datadir" | |
+ - "volumes/logs:/opt/teamcity/logs" | |
hostname: ${VIRTUAL_HOST} | |
ports: | |
- "8111" | |
depends_on: | |
- postgres | |
env_file: .env | |
labels: | |
- "traefik.enable=true" | |
- "traefik.backend=server" | |
- "traefik.frontend.rule=Host:${VIRTUAL_HOST}" | |
- "traefik.docker.network=web" | |
- "traefik.port=8111" | |
logging: | |
driver: json-file | |
options: | |
max-size: "10m" | |
@@ -34,34 +34,34 @@ services: | |
- redis | |
# if you need docker inside the agent | |
# (http://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/) | |
volumes: | |
- "/var/run/docker.sock:/var/run/docker.sock" | |
labels: | |
- "traefik.enable=false" | |
logging: | |
driver: json-file | |
options: | |
max-size: "10m" | |
max-file: "5" | |
postgres: | |
build: ./postgres | |
volumes: | |
- - "/opt/teamcity/pg_data:/var/lib/postgresql/data" | |
- - "/opt/teamcity/pg_backup:/backups" | |
+ - "volumes/pg_data:/var/lib/postgresql/data" | |
+ - "volumes/pg_backup:/backups" | |
env_file: .env | |
labels: | |
- "traefik.enable=false" | |
logging: | |
driver: json-file | |
options: | |
max-size: "10m" | |
max-file: "5" | |
redis: | |
image: redis:3.2 | |
labels: | |
- "traefik.enable=false" | |
logging: | |
driver: json-file | |
options: | |
@@ -83,26 +83,26 @@ services: | |
- --acme=true | |
- --acme.domains=${LETSENCRYPT_HOST} | |
- --acme.email=${LETSENCRYPT_EMAIL} | |
- --acme.storage=acme.json | |
- --acme.OnHostRule=false | |
- --acme.onDemand=false | |
- --acme.entryPoint=https | |
- --acme.httpChallenge | |
- --acme.httpChallenge.entryPoint=http | |
ports: | |
- "80:80" | |
- "443:443" | |
networks: | |
- web | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- - /opt/traefik/acme.json:/acme.json | |
+ - volumes/acme.json:/acme.json | |
logging: | |
driver: json-file | |
options: | |
max-size: "10m" | |
max-file: "5" | |
networks: | |
web: | |
external: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment