-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.override.yml
89 lines (77 loc) · 2.78 KB
/
docker-compose.override.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
version: "3.7"
volumes:
app_gem_bundle: # Who knew? Now this works!
app_node_modules: # See comment below on 'test' service's volume
services:
# The job processor container - we'll use this as a base for the rest of the
# containers:
test: &app
image: icalialabs/rails-and-flipper-demo:development
build:
context: .
target: development
args:
- DEVELOPER_UID=${UID:-1000}
- DEVELOPER_USER=${USER:-me}
entrypoint: /usr/src/bin/dev-entrypoint.sh
command: rspec
depends_on:
- postgres
volumes:
# Mount our app code directory (".") into our app containers at the
# "/usr/src" folder:
- .:/usr/src
- app_gem_bundle:/usr/local/bundle
# Replace the local 'node_modules' folder with a Docker volume, so we can
# run the frontend app either from the host (i.e. macOS) or using
# containers without having one or another clobbering the npm packages or
# conflicting versions for macOS / Linux:
- app_node_modules:/usr/src/node_modules
# Keep the stdin open, so we can attach to our app container's process and
# do things such as byebug, etc:
stdin_open: true
# Enable sending signals (CTRL+C, CTRL+P + CTRL+Q) into the container:
tty: true
# Specify environment variables available for our app containers. We'll
# leave a YML anchor in case we need to override or add more variables if
# needed on each app container:
environment: &app_env
# We'll set the DATABASE_URL environment variable for the app to connect
# to our postgres container:
DATABASE_URL: postgres://postgres:3x4mpl3P455w0rd@postgres:5432
# We'll set the RAILS_ENV and RACK_ENV environment variables to
# 'development', so our app containers will start in 'development' mode
# on this compose project:
RAILS_ENV: test
RACK_ENV: test
# This container autocompiles, serves and live-reloads Webpack assets
# (including our ReactJS code) for our development environment. This service
# is proxied by the `web` container, so there is no need to publish ports for
# it:
webpacker:
<<: *app
ports:
- ${RAILS_FLIPPER_DEMO_WEBPACKER_DEV_SERVER_PORT:-3035}:3035
depends_on: []
command: webpack-dev-server
labels:
com.icalialabs.plis.group: web
environment:
WEBPACKER_DEV_SERVER_HOST: 0.0.0.0
RAILS_ENV: development
web:
<<: *app
labels:
com.icalialabs.plis.group: web
depends_on:
- postgres
- webpacker
ports:
- ${RAILS_FLIPPER_DEMO_WEB_PORT:-3000}:3000
command: rails server -p 3000 -b 0.0.0.0
environment:
<<: *app_env
RACK_ENV: development
RAILS_ENV: development
WEBPACKER_DEV_SERVER_HOST: webpacker
RAILS_LOG_TO_STDOUT: 'true'