-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
137 lines (129 loc) · 5.03 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
126
127
128
129
130
131
132
133
134
135
136
137
version: '2'
services:
la-toolkit:
image: livingatlases/la-toolkit:latest
container_name: la-toolkit
restart: always
hostname: la-toolkit
ports:
- "2010:2010"
- "2011-2100:2011-2100"
# Internal an external ports should match in the previous range.
# So don't do these kind of redirections:
# - "3011-3100:2011-2100"
depends_on:
- mongo
environment:
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
# Useful for having logs with local time
TZ: "Europe/Copenhagen"
# db user/pass (should match the same mongo vars LA_USER/LA_PASS)
DATABASE_URL: mongodb://la_toolkit_user:la_toolkit_changeme@mongo:27017/la_toolkit
NODE_ENV: production
# TOOLKIT_SENTRY_DSN: "SOME_DSN"
#
# Advanced optional URLs (useful to enable https and use a proxy)
# TOOLKIT_PUBLIC_URL: "localhost:2010" or "toolkit.example.com"
# TOOLKIT_HTTPS: "false"
# TOOLKIT_TERM_PROXY: "false"
# In a simple desktop deployment, the toolkit uses localhost to connect to
# the backend and later opens other ports to show the terminal or SSH into
# servers, etc.
# However, in an public server deployment, a different schema is needed.
# Instead of connecting to localhost:SOMEPORT via websocket, we connect to
# la-toolkit.l-a.site/ttySOMEPORT, or similar and the proxy configuration
# redirects to the internal server:SOMEPORT.
# The TOOLKIT_TERM_PROXY flag allows the terminal to use the localhost
# schema if false or the proxy schema if true.
#
# In other words, if you are using the toolkit in a desktop, you don't
# need to configure nothing, but if you are trying to connect to a toolkit
# in an internal network without proxy configuration, SSL configuration, etc.
# configure it as follows:
# TOOLKIT_PUBLIC_URL: "10.1.2.3:2010"
# TOOLKIT_HTTPS: "false"
# TOOLKIT_TERM_PROXY: "false"
#
# But if you run the toolkit under a proxy, configure it instead as follows:
# TOOLKIT_PUBLIC_URL: "toolkit.l-a.site"
# TOOLKIT_HTTPS: "true"
# TOOLKIT_TERM_PROXY: "true"
#
# see: apache-vhost-sample.conf for a sample apache vhost configuration
# The volumes should be writeable by your user so maybe you have to set your uid:gid here
# user: 1000:1000
volumes:
# mkdir -p /data/la-toolkit/config/ /data/la-toolkit/logs/ /data/la-toolkit/ssh/
- /data/la-toolkit/config/:/home/ubuntu/ansible/la-inventories/:rw
- /data/la-toolkit/logs/:/home/ubuntu/ansible/logs/:rw
- /data/la-toolkit/ssh:/home/ubuntu/.ssh/:rw
- /home/ubuntu/.npm-packages
# For 'custom' ala-install
# Take into account that if your change from 'custom' to other ala-install version
# code changes will be git stashed
# - /data/la-toolkit/ala-install:/home/ubuntu/ansible/ala-install/:rw
mongo:
image: mongo:4
restart: always
container_name: la-toolkit-mongo
# Uncomment if mongo-express if you want to access mongo from the outside
# ports:
# - 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: la_toolkit_mongo_admin
MONGO_INITDB_ROOT_PASSWORD: la_toolkit_changeme
MONGO_INITDB_DATABASE: la_toolkit
LA_USER: la_toolkit_user
LA_PASS: la_toolkit_changeme
volumes:
# If you don't clone the la-toolkit repo you will need also the mongo-init.sh script that
# setup the db initially
- ./mongo-init.sh:/docker-entrypoint-initdb.d/mongo-init.sh
- /data/la-toolkit/mongo:/data/db
mongo-db-backup:
image: tiredofit/mongodb-backup
container_name: la-toolkit-mongo-db-backup
restart: always
links:
- mongo
depends_on:
- mongo
environment:
- DB_HOST=mongo
- DB_USER=la_toolkit_mongo_admin
- DB_PASS=la_toolkit_changeme
# Uncomment to debug in the logs the backups
# - DB_DUMP_DEBUG=TRUE
- DB_DUMP_FREQ=1440
# Uncomment to set a time to do the backup or uncomment to inmediate backup
# - DB_DUMP_BEGIN: 0000
- DB_CLEANUP_TIME=8640
- MD5=TRUE
- COMPRESSION=XZ
- TZ=Europe/Copenhagen
volumes:
- /data/la-toolkit/backups:/backups
# Optionally in production (because this will open your db to the outside):
#
# mongo-express:
# image: mongo-express
# container_name: la-toolkit-mongo-express
# restart: always
# depends_on:
# - mongo
# ports:
# - 9081:8081
# environment:
# ME_CONFIG_MONGODB_SERVER: mongo
# ME_CONFIG_MONGODB_ADMINUSERNAME: la_toolkit_mongo_admin
# ME_CONFIG_MONGODB_ADMINPASSWORD: la_toolkit_changeme
# 'watchtower' upgrade automatically the la-toolkit, whenever there is a new Docker image available,
# but a container restart is also need to get the new image
watchtower:
image: containrrr/watchtower
container_name: la-toolkit-watchtower
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# Additional watchtower args
# commmand: