forked from ComPlat/chemotion_ELN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yml
69 lines (63 loc) · 2.53 KB
/
docker-compose.dev.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
# This docker-compose file sets up the dev environment.
# It builds an app container based on Dockerfile.chemotion.dev
#
# USAGE:
# - Run app server: docker-compose -f docker-compose.dev.yml up
# - Initial dev setup without external seeds: docker-compose -f docker-compose.dev.yml run app bundle exec rake db:setup
# - Open shell within container (for rake tasks etc): docker-compose -f docker-compose.dev.yml run app /bin/bash
# - Run unit tests: docker-compose -f docker-compose.dev.yml run app bundle exec rspec --exclude-pattern spec/{features}/**/*_spec.rb
# - Run feature tests: docker-compose -f docker-compose.dev.yml run app bundle exec rspec spec/features
# - Run JS tests: docker-compose -f docker-compose.dev.yml run app npm test
# Note: all these commands can be run manually from the shell. This might be the better choice as docker creates an overlay FS for every run
#
version: '3'
services:
postgres:
image: 'postgres:14.2-alpine3.15'
environment:
- 'POSTGRES_HOST_AUTH_METHOD=trust'
expose: # expose port to app container
- '5432'
ports: # expose port to host machine in case we want to use external db gui tools
- '5432:5432'
volumes:
- 'database:/var/lib/postgresql/data'
app:
build:
context: '.'
dockerfile: 'Dockerfile.chemotion-dev'
depends_on:
- 'postgres'
environment:
- 'WEBPACKER_DEV_SERVER_HOST=webpacker'
- 'WEBPACKER_DEV_SERVER_PORT=3035'
- 'NODE_MODULES_PATH=/home/chemotion-dev/node_modules/' # required for the asset pipeline to find the node modules
- 'THOR_SILENCE_DEPRECATION=true'
ports: # expose default rails port to host machine
- "3000:3000"
volumes:
- 'homedir:/home/chemotion-dev/'
- '.:/home/chemotion-dev/app'
working_dir: "/home/chemotion-dev/app"
command: "./run-ruby-dev.sh"
webpacker:
build:
context: '.'
dockerfile: 'Dockerfile.chemotion-dev'
environment:
- 'WEBPACKER_DEV_SERVER_HOST=webpacker'
- 'WEBPACKER_DEV_SERVER_PORT=3035'
- 'NODE_MODULES_PATH=/home/chemotion-dev/node_modules/' # required for the asset pipeline to find the node modules
- 'WEBPACKER_NODE_MODULES_BIN_PATH=/node_modules/.bin' # required for webpacker to find the yarn binary
volumes:
- 'homedir:/home/chemotion-dev/'
- '.:/home/chemotion-dev/app'
ports: # expose webpacker dev server port to app container
- '3035:3035'
expose:
- '3035'
working_dir: "/home/chemotion-dev/app"
command: './run-js-dev.sh'
volumes:
database:
homedir: