-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yml
More file actions
38 lines (37 loc) · 1013 Bytes
/
Copy pathcompose.yml
File metadata and controls
38 lines (37 loc) · 1013 Bytes
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
services:
local:
build:
dockerfile: "Dockerfile"
target: "local"
ports:
- "0.0.0.0:${PORT:-8080}:8080"
env_file: ".env"
environment:
GOCACHE: "/cache/go-build"
GOMODCACHE: "/cache/pkg/mod"
INIT_CMD: "air"
# Host uid/gid from the environment (Makefile exports these for `make docker*`)
RUN_UID: ${UID:-1000}
RUN_GID: ${GID:-1000}
volumes:
- ".:/app"
- "./tmp/cache:/cache"
user: "root"
working_dir: "/app"
entrypoint: ["/bin/bash", "-c"]
command:
- |
set -euo pipefail
mkdir -p /app/data /cache/go-build /cache/pkg/mod
chown -R "$$RUN_UID:$$RUN_GID" /app/data /cache
exec setpriv --reuid="$$RUN_UID" --regid="$$RUN_GID" --clear-groups -- $$INIT_CMD
deploy:
build:
dockerfile: "Dockerfile"
target: "deploy"
ports:
- "0.0.0.0:${PORT:-8080}:8080"
env_file: ".env"
volumes:
- "./data:/app/data"
user: "${UID:-1000}:${GID:-1000}"