-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
99 lines (96 loc) · 3.16 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
---
#
# Cheat sheet:
#
# $ echo -e "UID=$(id -u)\nGID=$(id -g)" > .env
# $ docker compose up --build --detach dev
#
# $ docker compose exec --user dev --workdir /mnt/host dev bash
# # Compile with development mode enabled & run the application overriding
# # some settings in the configuration file.
# $ ENVIRONMENT=development make
# $ ./build/bin/varnishmon --config ./files/varnishmon.yml --loglevel info
#
# # Regenerate static assets & templates incrementally (useful when
# # compiling with development mode enabled).
# $ make webpack-watch
#
# # Regenerate static assets & templates, ready for production. Beware
# # generated files are versioned to simplify the whole packaging process.
# # It's ok to push generated static assets & templates to the repository
# # at any time, but the ideal scenario is to do it only when creating a
# # new release.
# $ make webpack-build
# $ git add ...
#
# # Run the test suite (or part of it).
# $ TEST_PACKAGES='./pkg/helpers/...' TEST_PATTERN='TestLogFileWriterTestSuite' make test
#
# # Trigger reopening of the log and database files.
# $ kill -HUP $(pgrep varnishmon)
#
# # Generate dist & package files. This will fail if activation of the
# # development mode is requested (i.e., ENVIRONMENT=development). Also,
# # beware packing is expected to be done on the target platform +
# # architecture.
# $ PLATFORM=noble make package
#
# # Periodic update of dependencies:
# # - Development & CI environments:
# # + extras/docker/Dockerfile: Go, Node.js, FPM, etc.
# # + .github/workflows/main.yml: Go, etc.
# # + extras/github/docker/*: FPM, etc.
# # + Makefile: Go tools, etc. + make mocks
# # - Go:
# # + go get -u ./... + make mod fmt lint vet test
# # - Node.js:
# # + rm -rf package-lock.json node_modules && npm update --save && npm audit fix
# # + npm outdated && npm install --save-dev <package>@latest
#
# # Fetch profiling data & metrics.
# $ curl -o /tmp/cpu.pprof http://127.0.0.1:6100/debug/pprof/profile?seconds=15
# $ curl -v http://127.0.0.1:6100/metrics
#
# $ docker compose exec --user root --workdir /root dev bash
# # Supervisor commands.
# $ supervisorctl status
# $ supervisorctl restart varnishd
#
# $ docker compose logs --follow dev
#
# $ docker compose down --volumes --remove-orphans
#
# $ IMAGE=$(docker build \
# --file extras/github/docker/Dockerfile-jammy \
# --build-arg GO_VERSION=1.23.5 \
# .)
# $ docker run \
# --rm \
# --volume .:/workspace \
# --workdir /workspace
# $IMAGE \
# bash -c '\
# git config --global --add safe.directory /workspace; \
# export PATH=/usr/local/go/bin:$PATH; \
# export PLATFORM=jammy; \
# make package'
#
name: varnishmon
services:
dev:
hostname: dev
build:
context: ./extras/docker
privileged: true
environment:
HOST_UID: ${UID:?}
HOST_GID: ${GID:?}
volumes:
- .:/mnt/host.raw
ports:
- 6100:6100
tmpfs:
- /run
- /run/lock
- /var/cache
- /tmp:exec