forked from ddnexus/pagy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
108 lines (100 loc) · 3.06 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
# Basic pagy-on-docker development environment
# it will keep the installed gems and HOME in the pagy_bundle and pagy_user_home pagy-on-docker volumes
# the pagy-jekill service will be updating a live preview for the docs
# USAGE
# cd pagy-on-docker
# docker-compose up pagy # only pagy service (running ruby development and test environment)
# docker-compose up pagy-jekyll # pagy and pagy-jekyll services (add the docs live site)
# docker-compose up pagy-cyress # pagy and pagy-cyress services (run the e2e tests and exit)
version: "3.8"
services:
# ruby dev and test pagy development
# It also runs a minimal sinatra app at http://0.0.0.0:8080
pagy:
image: pagy:4
build:
context: .
dockerfile: pagy.dockerfile
# set env variables with your user info
args:
user: $USER
group: $GROUP
uid: $UID
gid: $GID
password: "${PASSWORD:-rubydev}"
term: ${TERM:-xterm-256color}
container_name: pagy
volumes:
- ../.:/opt/project
- bundle:/usr/local/bundle
- user_home:/home/$USER
environment:
- COVERAGE_REPORT
ports:
# - "1234:1234" # RubyMine debugger
- "4567:4567" # default sinatra e2e/app.rb
- "8080:8080" # should you run the rackup apps/base_app.ru
command: rerun -- rackup -o 0.0.0.0 -p 4567 test/e2e/pagy_app.ru
stdin_open: true
tty: true
# Serve the docs site live at http://0.0.0.0:4000
# Use it to check/edit the rendered content in the docs dir
pagy-jekyll:
depends_on:
- pagy
image: pagy-jekyll:latest
build:
context: .
dockerfile: pagy-jekyll.dockerfile
container_name: pagy-jekyll
environment:
- JEKYLL_GITHUB_TOKEN
ports:
- "4000:4000"
- "35729:35729"
volumes:
- ../docs:/opt/docs
- docs_site:/opt/site
command: |
jekyll serve \
--incremental \
--livereload \
--watch \
--force-polling \
--host 0.0.0.0 \
--baseurl '' \
--source /opt/docs \
--destination /opt/site
stdin_open: true
tty: true
# you may want skip this service when you run the docker-compose.yml file
# and run it only on demand to run the tests and exit, or to interact with cypress
# using the additional open-cypress.yml (see the comments in the open-cypress.yml file)
# IMPORTANT: pick the build.dockerfile entry according to your UID
pagy-cypress:
depends_on:
- pagy
image: pagy-cypress:latest
build:
context: .
# switch between the following 2 lines if your user id is 1000 or not
dockerfile: pagy-cypress-uid1000.dockerfile
# dockerfile: pagy-cypress.dockerfile
args:
user: $USER
group: $GROUP
uid: $UID
gid: $GID
container_name: pagy-cypress
environment:
- CYPRESS_baseUrl=http://pagy:4567
working_dir: /test/e2e
volumes:
- ../test/e2e:/test/e2e
volumes:
bundle:
name: pagy_bundle
user_home:
name: pagy_user_home
docs_site:
name: pagy_docs_site