-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
114 lines (112 loc) · 3.33 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
version: '3.8'
services:
netbox: &netbox
build:
context: .
dockerfile: ./docker/Dockerfile
volumes:
- ./data/media:/opt/netbox/netbox/media
- ./scripts:/opt/netbox/netbox/scripts
- ./plugins:/opt/netbox/plugins
- ./custom_settings.py:/opt/netbox/netbox/netbox/custom_settings.py
- ./netbox/netbox/dcim/:/opt/netbox/netbox/dcim/
depends_on:
- db
- redis
- redis-cache
- netbox-worker
- smtp
environment:
- DB_USER=netbox
- DB_PASSWORD=develop
- DB_HOST=db
- SECRET_KEY=develop
- REDIS_HOST=redis
- REDIS_PASSWORD=develop
- REDIS_CACHE_HOST=redis-cache
- REDIS_CACHE_PASSWORD=develop
- REDIS_CACHE_DATABASE=0
- EMAIL_SERVER=smtp
- EMAIL_USERNAME=netbox@init7.local
- EMAIL_PASSWORD=1234
- LOGIN_REQUIRED=true
- MEDIA_ROOT=/opt/netbox/media
- RELEASE_CHECK_URL=https://api.github.com/repos/netbox-community/netbox/releases
- NAPALM_USERNAME=${NAPALM_USERNAME:-}
- NAPALM_PASSWORD=${NAPALM_PASSWORD:-}
- DB_WAIT_DEBUG=1
- PYTHONUNBUFFERED=1
- SKIP_STARTUP_SCRIPTS=true
- SKIP_SUPERUSER=true
- DJANGO_SETTINGS_MODULE=netbox.custom_settings
ports:
- "127.0.0.1:$NETBOX_HTTP_PORT:8080"
command: python manage.py runserver --skip-checks 0.0.0.0:8080
netbox-worker:
<<: *netbox
depends_on:
- db
- redis
- redis-cache
entrypoint:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
command:
- rqworker
expose: []
ports: []
labels: []
db:
image: postgres:13.3-alpine@sha256:cd1b837c86e9c2df778b3b4ece70dcd5a74f3ea68f82d00714aec91f34ba328d
environment:
- POSTGRES_USER=netbox
- POSTGRES_PASSWORD=develop
- POSTGRES_DB=netbox
volumes:
- ./data/postgres:/var/lib/postgresql/data
redis:
image: redis:6.2.5-alpine@sha256:ca9a5a3d4bb958793bb4c24034a3b99e5e13fb6a15b1a3ae70f9e21652a76aff
command:
- sh
- -c # this is to evaluate the $REDIS_PASSWORD from the env
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD ## $$ because of docker-compose
volumes:
- ./data/redis:/data
environment:
- REDIS_PASSWORD=develop
redis-cache:
image: redis:6.2.5-alpine@sha256:ca9a5a3d4bb958793bb4c24034a3b99e5e13fb6a15b1a3ae70f9e21652a76aff
command:
- sh
- -c # this is to evaluate the $REDIS_CACHE_PASSWORD from the env
- redis-server --requirepass $$REDIS_CACHE_PASSWORD ## $$ because of docker-compose
environment:
- REDIS_CACHE_PASSWORD=develop
smtp:
image: mailhog/mailhog
command: ["-smtp-bind-addr", "0.0.0.0:25"]
user: root
expose:
- 25
- 8025
ports:
- "127.0.0.1:$MAILHOG_HTTP_PORT:8025"
networks:
- default
healthcheck:
test: echo | telnet 127.0.0.1 25
vault:
image: vault
environment:
- 'VAULT_LOCAL_CONFIG={"backend": {"file": {"path": "/vault/file"}}, "ui": true, "default_lease_ttl": "168h", "max_lease_ttl": "720h", "listener": {"tcp": {"address": "0.0.0.0:8200", "tls_disable": "true"}}}'
cap_add:
- IPC_LOCK
volumes:
- ./data/vault/file:/vault/file
- ./data/vault/config:/vault/config
command:
- server
ports:
- "127.0.0.1:8200:8200"
networks:
default: