This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdocker-compose.yml
111 lines (106 loc) · 2.75 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
100
101
102
103
104
105
106
107
108
109
110
111
version: "3.9"
networks:
next-docs-net:
volumes:
node_modules:
redis_data:
# Default for all services
x-service-defaults: &service-defaults
restart: unless-stopped
networks:
- next-docs-net
# Defaults for all app-based node services
x-app-defaults: &app-defaults
<<: *service-defaults
build:
context: .
dockerfile: Dockerfile.dev
command: ["yarn"]
working_dir: /opt/next-docs
depends_on:
- cache
restart: on-failure
environment:
REDIS_URL: redis://:flow_docs@cache:6379
REFRESH_CACHE_SECRET: for-testing-only
INCOMPLETE_PAGE_BEHAVIORL: preview
SENTRY_ENV: sentry-development
SHELL: /bin/bash
PORT: 3000
REMIX_DEV_SERVER_WS_PORT: 8002
LOG_LEVEL: "debug"
ENABLE_CONTENT_CHECKER: "true"
volumes:
- .:/opt/next-docs
- ./package.json:/opt/next-docs/package.json
- ./yarn.lock:/opt/next-docs/yarn.lock
- node_modules:/opt/next-docs/node_modules
services:
cache:
<<: *service-defaults
image: "redis:alpine"
command: redis-server --requirepass flow_docs
volumes:
- redis_data:/data
# Run yarn on startup to make sure our packages are up-to-date.
app-yarn:
<<: *app-defaults
restart: on-failure
# Watches for CSS changes and rebuilds
app-css:
<<: *app-defaults
command: ["yarn", "run", "dev:css"]
healthcheck:
# service is healthy once main.css has been generated
test: bash -c "[ -f /opt/next-docs/app/main.css ]"
interval: 10s
retries: 5
start_period: 5s
# postcss exits without an stdin
# See: https://github.com/postcss/postcss-cli/pull/424
tty: true
depends_on:
app-yarn:
condition: service_completed_successfully
# Watches for SVG changes and recreates their components as needed.
app-svg:
<<: *app-defaults
command: ["yarn", "run", "dev:svg"]
healthcheck:
# "dev:svg" executes "touch /tmp/svgs-generated" after each run, so we
# check that this file has been updated within the last 1 minute
test: test `find /tmp/svgs-generated -type f -mmin -1`
interval: 5s
retries: 5
start_period: 15s
depends_on:
app-yarn:
condition: service_completed_successfully
# The main application
app:
<<: *app-defaults
command: ["yarn", "run", "dev:remix"]
ports:
- "3000:3000" # Web app port
- "8002:8002" # Websocket for live-reload
depends_on:
app-css:
condition: service_healthy
app-svg:
condition: service_healthy
storybook:
<<: *app-defaults
profiles: ["storybook"]
command:
[
"yarn",
"run",
"start-storybook",
"-p",
"6006",
"--quiet",
"--no-open",
"--disable-telemetry",
]
ports:
- "6006:6006"