-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
125 lines (120 loc) · 3.76 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# This file uses environment variables
# to override any settings add a file called '.env'
# with new environment variable values
# example: "DATABASE_USERNAME=NikZy"
version: "3"
networks:
hilfling-network: # Used for internal networking
driver: bridge
volumes:
db-data: # Data volume for the database
services:
traefik:
image: "traefik:v2.10"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:8000"
- "--entrypoints.websecure.address=:443"
ports:
- "8080:8080"
- "443:443"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
labels:
- "traefik.enable=true"
- "traefik.http.routers.traefik.rule=Host(`127.0.0.1`)"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.middlewares=traefik-auth"
- "traefik.http.middlewares.traefik-auth.basicauth.users=user:$$2y$$05$$6m8MvyzgJ4Kl7/3rL4X6VurX1huMas8a7oPB3xRfBjFbGCR8MUi7W"
backend:
container_name: backend
build:
context: .
dockerfile: ./Dockerfile # specify the Dockerfile
networks:
- hilfling-network
depends_on:
- postgres
- traefik
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/hilflingdb
SPRING_DATASOURCE_USERNAME: ${DATABASE_USERNAME:-hilfling}
SPRING_DATASOURCE_PASSWORD: ${DATABASE_PASSWORD:-password}
ports:
- "8000:8000" # map port 8000 of the host to port 8080 of the container
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=Host(`backend.localhost`)"
- "traefik.http.routers.backend.entrypoints=web"
postgres:
container_name: hilflingdb
build:
context: .
dockerfile: postgres/Dockerfile
restart: always
depends_on:
- traefik
networks:
- hilfling-network
volumes:
- "db-data:/var/lib/postgresql/data" # Database volume
#- "./postgres/sql:/base-sql" # Think this was init sql schema?
expose:
- 5432
ports:
- "5432:5432"
environment:
# Use env variable if exists, fallback to hilfling
POSTGRES_USER: ${DATABASE_USERNAME:-hilfling}
POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-password}
LISTENING_PORT: ${LISTENING_PORT-8000}
labels:
- "traefik.enable=true"
- "traefik.http.routers.postgres.rule=Host(`hilfling-db.localhost`)"
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4
restart: always
depends_on:
- traefik
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-password}
ports:
- ${PGADMIN_PORT:-5050}:80
networks:
- hilfling-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.pgadmin.rule=Host(`pgadmin.localhost`)"
- "traefik.http.routers.pgadmin.entrypoints=web"
fg-static:
container_name: hilfling-static
#image: fotogjengen/hilfling-static # Don't need to push this to a registry
build:
context: ./static-files
dockerfile: Dockerfile
environment:
NGINX_HOST: ${NGINX_HOST:-fg-static.nikzy.no}
NGINX_PORT: ${NGINX_PORT:-80}
ports:
- 8383:${NGINX_PORT:-80}
volumes:
- ./static-files/static/:/usr/share/nginx/html
fg-blob-storage:
container_name: hilfling-blob-storage
image: mcr.microsoft.com/azure-storage/azurite
volumes:
- ./static-files/blob_storage/:/data
restart: always
networks:
- hilfling-network
ports:
- "10000:10000"
- "10001:10001"
- "10002:10002"