-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
79 lines (71 loc) · 2.67 KB
/
Copy pathdocker-compose.yml
File metadata and controls
79 lines (71 loc) · 2.67 KB
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
# ---------------------------------------------------------------
# WatchDocs - docker compose stack
# Service : watchdocs
# Image : watchdocs:1.0.0
# Host : watchdocs.dynamicdev.asia
# Port : 3355:3355
# Network : dynamicdev-net (external - shared across the ecosystem)
# ---------------------------------------------------------------
services:
watchdocs:
# Build the image locally from the Dockerfile in this repo
build:
context: .
dockerfile: Dockerfile
# Tag the built image so it can be re-used, pushed, or pulled by name
image: watchdocs:1.0.0
container_name: watchdocs
hostname: watchdocs
restart: unless-stopped
# Host-to-container port mapping (left side = host, right side = container)
ports:
- "3355:3355"
environment:
NODE_ENV: production
PORT: 3355
HOSTNAME: 0.0.0.0
NEXT_TELEMETRY_DISABLED: "1"
# Public URL used for share links, metadata, and absolute URLs
NEXT_PUBLIC_APP_URL: https://watchdocs.dynamicdev.asia
# Reference an existing Postgres container on the same docker network.
# Override these in a local .env file when deploying.
DATABASE_URL: ${DATABASE_URL:-}
TZ: Asia/Bangkok
# Attach to the shared ecosystem network so it can be routed by the
# reverse proxy (Traefik / Nginx Proxy Manager / Caddy) and reach other
# services such as postgres by container name.
networks:
- dynamicdev-net
# Reverse-proxy hints - enable if Traefik is the active edge router
labels:
- "com.dynamicdev.project=watchdocs"
- "com.dynamicdev.version=1.0.0"
- "traefik.enable=true"
- "traefik.http.routers.watchdocs.rule=Host(`watchdocs.dynamicdev.asia`)"
- "traefik.http.routers.watchdocs.entrypoints=websecure"
- "traefik.http.routers.watchdocs.tls.certresolver=letsencrypt"
- "traefik.http.services.watchdocs.loadbalancer.server.port=3355"
- "traefik.docker.network=dynamicdev-net"
# Container-level healthcheck mirrors the one in the Dockerfile so that
# docker compose can flag the service as unhealthy without touching the
# image layer.
healthcheck:
test:
- CMD-SHELL
- "wget --no-verbose --tries=1 --spider http://127.0.0.1:3355/ || exit 1"
interval: 30s
timeout: 5s
start_period: 20s
retries: 3
# Keep logs bounded to avoid filling up the host disk
logging:
driver: json-file
options:
max-size: "10m"
max-file: "5"
networks:
# External means the network must already exist on the host.
# Create it once with: docker network create dynamicdev-net
dynamicdev-net:
external: true
name: dynamicdev-net