forked from denny/MahBucket
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
58 lines (53 loc) · 1.72 KB
/
docker-compose.yml
File metadata and controls
58 lines (53 loc) · 1.72 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
version: '3'
x-service-fragments:
##### Abstract services for common setup #####
app: &app
image: cimg/ruby:3.3.5-browsers
networks:
- default
volumes:
# Use cached bind mount for mac performance
- '.:/app:cached'
# use separate volume for gems and node packages to make development nicer
- bundle_cache:/bundle
- node_cache:/app/node_modules
- webdriver_cache:/root/.webdrivers
# use separate volume for bootsnap cache for performance...
- tmp_cache:/app/tmp/cache
services:
##### Concrete services #####
postgres:
image: 'cimg/postgres:10.20'
environment:
# The Postgres image uses these to create a db user - note the user/pass here should match that in your env file!
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
- POSTGRES_DB=mahbucket_test
volumes:
- 'postgres:/var/lib/postgresql/data'
web:
<<: *app
volumes:
- '.:/usr/src/app:cached'
working_dir: /usr/src/app
ports:
# Use a default port of 3005, but allow it to be overriden by an env variable
# E.g. `PORT=3001 docker-compose up`
- '${PORT:-3005}:3000'
stdin_open: true
tty: true
depends_on:
- postgres
environment:
- DATABASE_URL=postgres://user:password@postgres/mahbucket
- RACK_ENV=test
- RAILS_ENV=test
- DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL=true
- SKIP_AUTH=true
command: sh -c 'bundle check || bundle install && rm -f /tmp/.X99-lock && bundle exec rails db:create db:environment:set db:schema:load && bundle exec rubocop && bundle exec rspec && bundle exec puma -C ./config/puma.rb'
volumes:
postgres:
bundle_cache:
node_cache:
tmp_cache:
webdriver_cache: