-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
76 lines (66 loc) · 2.61 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
version: "3.4"
services:
integresql:
build:
context: .
target: development
# ports:
# - "5000:5000"
working_dir: /app
# linux permissions / vscode support: we must explicitly run as the development user
user: development
volumes:
# mount working directory
# https://code.visualstudio.com/docs/remote/containers-advanced#_update-the-mount-consistency-to-delegated-for-macos
# https://docs.docker.com/docker-for-mac/osxfs-caching/#delegated
# the container’s view is authoritative (permit delays before updates on the container appear in the host)
- .:/app:delegated
# mount cached go pkg downloads
- go-pkg:/go/pkg
# mount cached vscode container extensions
# https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild
- vscode-extensions:/home/development/.vscode-server/extensions
- vscode-extensions-insiders:/home/development/.vscode-server-insiders/extensions
depends_on:
- postgres
environment: &SERVICE_ENV
PGDATABASE: &PSQL_DBNAME "sample"
PGUSER: &PSQL_USER "dbuser"
PGPASSWORD: &PSQL_PASS "testpass"
PGHOST: &PSQL_HOST "postgres"
PGPORT: &PSQL_PORT "5432"
PGSSLMODE: &PSQL_SSLMODE "disable"
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
cap_add:
- SYS_PTRACE
security_opt:
- seccomp:unconfined
# Overrides default command so things don't shut down after the process ends.
# Overrides default command so things don't shut down after the process ends.
command:
- /bin/sh
- -c
- |
git config --global --add safe.directory /app
while sleep 1000; do :; done
postgres:
image: postgres:12.4-alpine # should be the same version as used in .drone.yml, Dockerfile and live
command: "postgres -c 'shared_buffers=128MB' -c 'fsync=off' -c 'synchronous_commit=off' -c 'full_page_writes=off' -c 'max_connections=100' -c 'client_min_messages=warning'"
expose:
- "5432"
ports:
- "5434:5432"
environment:
POSTGRES_DB: *PSQL_DBNAME
POSTGRES_USER: *PSQL_USER
POSTGRES_PASSWORD: *PSQL_PASS
volumes:
- pgvolume:/var/lib/postgresql/data
volumes:
pgvolume: # declare a named volume to persist DB data
# go: go mod cached downloads
go-pkg:
# vscode: Avoiding extension reinstalls on container rebuild
# https://code.visualstudio.com/docs/remote/containers-advanced#_avoiding-extension-reinstalls-on-container-rebuild
vscode-extensions:
vscode-extensions-insiders: