-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
71 lines (69 loc) · 2.64 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
version: '3.0'
services:
# MySql Server
mysqldb:
image: mysql:8.1
container_name: af_db
restart: unless-stopped
# load extra environment variables from file
env_file: ./.env
# Set manual environment variables
environment:
- MYSQL_ROOT_PASSWORD=$MYSQLDB_PASSWORD
- MYSQL_DATABASE=AnsibleForms
ports:
# Mount host port to docker internal port
- $MYSQLDB_LOCAL_PORT:$MYSQLDB_DOCKER_PORT
volumes:
# Map database location (to maintain persistency)
- ./data/mysql/db:/var/lib/mysql
# Map my.cnf file (to maintain persistency)
- ./data/mysql/my.cnf:/etc/mysql/my.cnf
# Map init sql scripts
- ./data/mysql/init:/docker-entrypoint-initdb.d
# AnsibleForms application
app:
# Only start after MySql
depends_on:
- mysqldb
image: ansibleguy/ansibleforms:latest
container_name: af_app
restart: unless-stopped
ports:
# Mount host port to docker internal port
- $WEBAPP_LOCAL_PORT:$WEBAPP_DOCKER_PORT
# Load extra environment variables from file
env_file:
- ./.env
# Set environment variables
environment:
- DB_HOST=mysqldb
- DB_USER=$MYSQLDB_USER
- DB_PASSWORD=$MYSQLDB_PASSWORD
- DB_PORT=$MYSQLDB_DOCKER_PORT
- PORT=$WEBAPP_DOCKER_PORT
# adding python path to add our custom persistent lib location
- PYTHONPATH=/usr/lib/python311.zip:/usr/lib/python3.11:/usr/lib/python3.11/lib-dynload:/usr/lib/python3.11/site-packages:/app/dist/persistent/python/lib
# allow interactive shell
stdin_open: true
# allow terminal
tty: true
volumes:
# Mount application folder to host folder (to maintain persistency)
- ./data:/app/dist/persistent
# Mount images folder to host folder (to have custom images)
- ./data/images:/app/dist/views/assets/images
# Mount logo (to have custom logo)
#- ./data/images/mylogo.svg:/app/dist/views/assets/img/logo_ansible_forms_full_white.svg
# Mount background image (to have custom background)
#- ./data/bg.jpg:/app/dist/views/assets/img/bg.jpg
# Map custom functions for js expressions and jq
- ./data/functions/custom.js:/app/dist/src/functions/custom.js
- ./data/functions/jq.custom.definitions.js:/app/dist/src/functions/jq.custom.definitions.js
# Map custom sshkey to local node .ssh location
- ./data/ssh:$HOME_DIR/.ssh
- ./data/git/.gitconfig:$HOME_DIR/.gitconfig
# Map custom ansible.cfg
- ./data/ansible/ansible.cfg:/etc/ansible/ansible.cfg
- ./data/ansible/roles:/etc/ansible/roles
- ./data/ansible/collections:/etc/ansible/collections