-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
104 lines (100 loc) · 3.05 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
# https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields
x-service-provisioning-base: &provisioning-base
build:
args:
GID: ${GID:-0}
UID: ${UID:-0}
context: .
dockerfile: Dockerfile.d/provisioning/Dockerfile
command:
- zsh
- --login
- -c
- |
docker-util.keep-running.zsh --reset-status
ansible-galaxy install -r requirements.yml\
&& docker-util.keep-running.zsh --record-success\
|| {
docker-util.keep-running.zsh --record-failure
exit 1
}
docker-util.keep-running.zsh --wait-signals
environment: &provisioning-base-environment
PROJECT_UNIQUE_ID: ~
init: true
user: "${UID:-0}:${GID:-0}"
volumes:
- provisioning-tmp:/tmp/provisioning
- provisioning-home-developer:/home/developer
- provisioning-home-root:/root # for macOS & Windows
- /var/run/docker.sock:/var/run/docker.sock
- .:/workspace
- ${HOME}/.ssh:/root/.ssh:ro # for macOS & Windows
- ${HOME}/.ssh:/home/developer/.ssh:ro
working_dir: /workspace
x-environment-binhost-port-published: &environment-binhost-port-published 8080
services:
portage-binhost:
image: ghcr.io/mazgi/portage-binhost
init: true
ports:
- target: 80
published: *environment-binhost-port-published
# You are able to implement your service like below.
provisioning:
<<: *provisioning-base
command:
- zsh
- --login
- -c
- |
docker-util.keep-running.zsh --reset-status
{
ansible-galaxy install -r requirements.yml\
&& /workspace/scripts/provisioning.update-portage-binhost-settings.zsh\
--binhost http://$${PORTAGE_BINHOST_HOST}:$${PORTAGE_BINHOST_PORT}
}\
&& docker-util.keep-running.zsh --record-success\
|| {
docker-util.keep-running.zsh --record-failure
exit 1
}
docker-util.keep-running.zsh --wait-signals
environment:
ANSIBLE_CONFIG: /workspace/config/ansible.cfg
PORTAGE_BINHOST_HOST: ${PUBLIC_IP_ADDR_OR_FQDN:-localhost}
PORTAGE_BINHOST_PORT: *environment-binhost-port-published
# for Prettier Code Formatter
# ["INFO" - 00:00:00 AM] Attempted to determine module path from /path/to/the/project
# ["ERROR" - 00:00:00 AM] Failed to load module. If you have prettier or plugins referenced in package.json, ensure you have run `npm install`
# ["ERROR" - 00:00:00 AM] Cannot find module 'prettier' from '/path/to/the/project'
workspace:
build:
args:
GID: ${GID:-0}
UID: ${UID:-0}
context: .
dockerfile: Dockerfile.d/workspace/Dockerfile
command:
- zsh
- --login
- -c
- |
npm-check-updates --upgrade
npm install
npm audit fix
sort-package-json
sleep infinity
init: true
user: ${UID:-0}:${GID:-0}
volumes:
- .:/workspace
working_dir: /workspace
version: "3.9"
volumes:
provisioning-tmp:
driver: local
provisioning-home-developer:
driver: local
provisioning-home-root:
driver: local