forked from beyond-z/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
80 lines (75 loc) · 3.46 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
#Note: this file is used to bring up a development environment. For staging and production environments, see heroku.yml
version: "3.5"
services:
canvasdb:
image: postgres:11.7
volumes:
- ./latest.dump:/latest.dump
- canvas-db:/var/lib/postgresql/data
networks:
- bravendev
environment:
POSTGRES_USER: canvas
POSTGRES_DB: canvas
POSTGRES_HOST_AUTH_METHOD: trust
canvasredis:
image: redis:5.0.6
networks:
- bravendev
canvasweb:
build:
context: .
command: /app/docker-compose/scripts/docker_compose_run.sh
# Temporarily replace the command above with this if you want the container to just stay open
# so you can connect and troubleshoot b/c the container exits when you bring it up.
#tty: true
ports:
- "3000:3000"
# Mount some specific dirs as volumes (not persistent for now, we would have to name them to make them persist)
# so that you can make changes outside the container and have them reflect inside the container (and vice versa)
# without needing to rebuild the containter.
# Note: we don't mount the entire root directory, e.g ".", b/c it's easy for generated things to conflict between
# builds. E.g. if you run a bundle install outside the container, then .bundle/config will have it's path set and
# then inside the container it may be wrong and not match what was built in the Dockerfile. Or if you recompile just
# a piece of the assets inside the container and then try to rebuild the whole container, you may end up with the piece
# you rebuilt to try something out in place after the rebuild which you would expect to be a clean state b/c the rebuild
# inside also changed the files outside and after the rebuild you end up mounting the old thing into the container when
# you really want a fresh copy.
# So we only mount the things we want to actively edit outside the container and have them reflected inside for dev
# purposes. For rarer things that we want to tinker with, do it inside the container, get it right, then copy it
# outside and rebuild the container.
#
# Summary: IF YOU MAKE A CHANGE to any file not mounted here outside the container, you have to rebuild the container
# for the container to pick up the change!
volumes:
- ./app:/app/app
- ./lib:/app/lib
- ./config:/app/config
- ./Gemfile.d:/app/Gemfile.d
- ./Gemfile.lock:/app/Gemfile.lock
- ./log:/app/log
- ./script:/app/script
- ./spec:/app/spec
- ./db/migrate:/app/db/migrate
- ./docker-compose:/app/docker-compose
- ./public/bz_support.js:/app/public/bz_support.js
- ./public/bz_support.css:/app/public/bz_support.css
# Note: if you try and mount the entire "public" directory as a volume, it will mask the stuff generated inside
# the container at build time during compile_assets and you'll get all sorts of "not found" console errors.
networks:
- bravendev
environment:
RACK_ENV: development
AWS_BUCKET: ${AWS_BUCKET}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
depends_on:
- canvasdb
- canvasredis
# Note all Braven web app docker dev envs use this same network so they can talk to each other.
# E.g. the hostname joinweb will resolve inside the ssoweb container if they are on the same docker network.
networks:
bravendev:
name: braven_dev_network
volumes:
canvas-db: