Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (55 loc) · 2.11 KB
/
Copy pathdocker-compose.yml
File metadata and controls
58 lines (55 loc) · 2.11 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
name: opengym
services:
# One-time: download the exercise images + GIFs into ./media (skipped if already there).
# ~140 MB, from github.com/hasaneyldrm/exercises-dataset (CC).
media:
image: alpine/git
volumes:
- ./media/img:/out/img
- ./media/gif:/out/gif
entrypoint: ["/bin/sh", "-c"]
command:
- |
if [ -z "$$(ls -A /out/img 2>/dev/null)" ]; then
echo "↓ Downloading exercise media (~140 MB, one time)…"
git clone --depth 1 https://github.com/hasaneyldrm/exercises-dataset /tmp/ds
cp /tmp/ds/images/*.jpg /out/img/ && cp /tmp/ds/videos/*.gif /out/gif/
echo "✓ Exercise media ready ($$(ls /out/img | wc -l) images)."
else
echo "✓ Exercise media already present — skipping download."
fi
restart: "no"
# Passkey auth + per-user data (Node, no framework).
# image: prebuilt (docker compose pull). build: from source (docker compose up --build).
api:
image: ghcr.io/duartesantos8/opengym-api:latest
build: ./api
restart: unless-stopped
env_file: .env
environment:
- PORT=3000 # internal port (nginx proxies here) — do not change
- DATA_DIR=/data
- COACH_CODEX_HOME=/codex
volumes:
- ./data:/data # users, passkeys, per-user state, session secret — BACK THIS UP
# ChatGPT/Codex refresh tokens are kept separate from app data and mounted only into the
# API container. This directory is owned by the unprivileged Coach runtime.
- ./data/codex:/codex
# Builds the React frontend (multi-stage) and serves it, proxying /api → api
# and the exercise media from the shared volume. Single origin for passkeys.
web:
image: ghcr.io/duartesantos8/opengym-web:latest
build:
context: .
dockerfile: web/Dockerfile
restart: unless-stopped
depends_on:
media:
condition: service_completed_successfully
api:
condition: service_started
ports:
- "${WEB_PORT:-8080}:80"
volumes:
- ./media/img:/usr/share/nginx/html/img:ro
- ./media/gif:/usr/share/nginx/html/gif:ro