-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.dock
52 lines (40 loc) · 1.26 KB
/
.dock
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
# Configures the development/test environment for the Verifier.
project=verifier
build_context dock
dockerfile dock/development_Dockerfile
# Whether or not we're running in a CI context
ci() {
[ "${CI:-0}" = 1 ]
}
env_var CI "{CI:-0}"
# Ensure the container runs as the current user, otherwise the files in the git
# repo may have their ownership changed to root
env_var APP_UID $(user_id)
env_var APP_GID $(group_id)
# Expose Docker Hub credentials if they exist
if [ -d "$HOME/.docker" ]; then
volume "$HOME/.docker:/home/app/.docker"
fi
if ! ci; then
# Startup services.
startup_services "verifier"
# Only persists files to be used across project builds
# when not running in CI context
volume "${project}_tmp:/tmp"
volume "${project}_cache:/home/app/.cache"
volume "${container_name}_docker:/var/lib/docker:rw"
# Setup the network in host mode
run_flags --network host
else
# Startup services
startup_services "verifier_test"
# Only persists files to be used across project builds
# when not running in CI context
volume "/tmp"
volume "/home/app/.cache"
# Setup the network in bridge mode
run_flags --network bridge
fi
# If no command is specified, start a running instance in a container
default_command dock/start-everything
# vi: ft=sh