-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
104 lines (96 loc) · 2.13 KB
/
Copy pathdocker-compose.yml
File metadata and controls
104 lines (96 loc) · 2.13 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
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
# `docker compose up` starts the web stack: rails, vite, sidekiq, postgres, redis.
# Utility/test-only services are behind profiles so they don't collide or clutter:
# runner (profile: tools) — one-off commands, e.g. `docker compose run --rm runner ./bin/setup`
# selenium (profile: test) — system specs; started explicitly by CI
x-app: &app
build:
context: .
args:
RUBY_VERSION: '3.4.10'
NODE_MAJOR: '20'
BUNDLER_VERSION: '2.7.0'
image: stemcoding:latest
stdin_open: true
tty: true
volumes:
- .:/app:cached
- rails_cache:/app/tmp/cache
- bundle:/bundle
- node_modules:/app/node_modules
environment: &app_env
NODE_ENV: development
RAILS_ENV: ${RAILS_ENV:-development}
REDIS_URL: redis://redis:6379/
DATABASE_URL: postgres://postgres:postgres@postgres:5432
BOOTSNAP_CACHE_DIR: /bundle/bootsnap
VITE_RUBY_HOST: vite
WEB_CONCURRENCY: 1
HISTFILE: /app/log/.bash_history
PSQL_HISTFILE: /app/log/.psql_history
EDITOR: vi
CONTAINERIZED: "true"
DATABASE_HOST: postgres
DATABASE_USER: postgres
DATABASE_PASSWORD: ""
tmpfs:
- /tmp
depends_on:
- postgres
- redis
services:
rails:
<<: *app
command: bundle exec rails server -b 0.0.0.0
ports:
- '3000:3000'
depends_on:
- postgres
- redis
- vite
vite:
<<: *app
command: bin/vite dev
ports:
- '3036:3036'
environment:
<<: *app_env
VITE_RUBY_HOST: 0.0.0.0
sidekiq:
<<: *app
command: bundle exec sidekiq
depends_on:
- postgres
- redis
runner:
<<: *app
command: /bin/bash
profiles:
- tools
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres:/var/lib/postgresql/data
ports:
- 5432
redis:
image: redis:7-alpine
volumes:
- redis:/data
ports:
- 6379
selenium:
image: selenium/standalone-chromium
shm_size: 2gb
ports:
- '4444:4444'
profiles:
- test
volumes:
postgres:
redis:
bundle:
node_modules:
rails_cache: