forked from ComPlat/chemotion_ELN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
91 lines (86 loc) · 2.58 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# This docker-compose file sets up the dev environment.
# It builds an app container based on Dockerfile.chemotion.dev
#
# USAGE:
# - Run development environment:
# docker-compose -f docker-compose.dev.yml up postgres app webpacker
# - Open a bash shell in the app container:
# docker exec -it NAME_OF_APP_CONTAINER_FROM_DOCKER_PS /bin/bash
# - Run tests:
# bundle exec rspec
#
# - see .dockerenv.example for environment variables usage
x-common-volumes:
- &vhome homedir:/home/chemotion-dev
- &vapp .:/home/chemotion-dev/app
services:
postgres:
image: ${DOCKER_PG_IMAGE:-postgres:14}
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'
# args:
# source_image: ${DOCKER_DEV_IMAGE:-ubuntu:jammy} # Build ARG for base image
# FULL_BUILD: ${FULL_BUILD:-}
image: ${DOCKER_DEV_IMAGE:-}
depends_on:
- 'postgres'
healthcheck:
test: ["CMD", "bundle", "check"] # exit 0 if all gems from Gemfile are installed, otherwise exit 1
interval: 30s
timeout: 10s
env_file:
- ./.env
environment:
- 'SHAKAPACKER_DEV_SERVER_HOST=webpacker'
- 'SHAKAPACKER_DEV_SERVER_PORT=3035'
- 'THOR_SILENCE_DEPRECATION=true'
- RAKE_DB_MIGRATE=${RAKE_DB_MIGRATE:-never}
ports: # expose default rails port to host machine
- "3000:3000"
volumes:
- *vhome
- *vapp
working_dir: "/home/chemotion-dev/app"
command: "./run-ruby-dev.sh"
webpacker:
build:
context: '.'
dockerfile: 'Dockerfile.chemotion-dev'
# args:
# source_image: ${DOCKER_DEV_IMAGE:-ubuntu:jammy} # Build ARG for base image
# FULL_BUILD: ${FULL_BUILD:-}
image: ${DOCKER_DEV_IMAGE:-}
depends_on:
app:
condition: service_healthy
environment:
- 'NODE_ENV=development'
- 'SHAKAPACKER_DEV_SERVER_HOST=webpacker'
- 'SHAKAPACKER_DEV_SERVER_PORT=3035'
env_file:
- ./.env
#- ./.env.development
volumes:
- *vhome
- *vapp
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:
name: ${VOLUME_NAME_DB:-chemotion_eln_database}
homedir:
name: ${VOLUME_NAME_HOMEDIR:-chemotion_eln_homedir}