Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose #32

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,7 @@

```
export REGISTRY='registry.mapotempo.com/'
```

### geocoder
```
docker build -f ./docker/Dockerfile -t ${REGISTRY}mapotempo-ce/geocoder-api:latest .
```

### addok
```
docker build -f ./docker/addok/Dockerfile -t ${REGISTRY}mapotempo/addok:latest .
docker-compose -f docker-compose.yml -f docker-compose-build.yml build
```

## Running services
Expand Down
14 changes: 14 additions & 0 deletions docker/docker-compose-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.7'
services:
api:
build:
context: ..
dockerfile: docker/Dockerfile

# France
addok-fr:
build: addok

# Luxemburg
addok-lu:
build: addok
34 changes: 34 additions & 0 deletions docker/docker-compose-swarm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3.7'
services:
api:
deploy:
update_config:
order: start-first
restart_policy:
condition: any

# France
addok-fr:
deploy:
update_config:
order: start-first
restart_policy:
condition: any

redis-server-fr:
deploy:
restart_policy:
condition: any

# Luxemburg
addok-lu:
deploy:
update_config:
order: start-first
restart_policy:
condition: any

redis-server-lu:
deploy:
restart_policy:
condition: any
24 changes: 0 additions & 24 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ services:
- ./production.rb:/srv/app/config/environments/production.rb
- ./access.rb:/srv/app/config/access.rb
- ./poly:/srv/app/poly
deploy:
update_config:
order: start-first
restart_policy:
condition: any
environment:
APP_ENV: production # Swith to "development" for more traces
REDIS_HOST: redis-cache
Expand All @@ -26,9 +21,6 @@ services:
redis-cache:
image: redis:${REDIS_VERSION:-3.2-alpine}
command: redis-server --save ""
deploy:
restart_policy:
condition: any
networks:
- redis_cache

Expand All @@ -47,11 +39,6 @@ services:
ADDOK_HOST: "redis-server-fr"
ADDOK_ATTRIBUTION: "BANO"
ADDOK_LICENCE: "ODbL"
deploy:
update_config:
order: start-first
restart_policy:
condition: any
networks:
- addok_fr
- redis_server_fr
Expand All @@ -61,9 +48,6 @@ services:
volumes:
- ./data-fr:/data
command: redis-server --save ""
deploy:
restart_policy:
condition: any
networks:
- redis_server_fr

Expand All @@ -76,11 +60,6 @@ services:
ADDOK_HOST: "redis-server-lu"
ADDOK_ATTRIBUTION: "Grand-Duché of Luxembourg"
ADDOK_LICENCE: "CC0"
deploy:
update_config:
order: start-first
restart_policy:
condition: any
networks:
- addok_lu
- redis_server_lu
Expand All @@ -90,9 +69,6 @@ services:
volumes:
- ./data-lu:/data
command: redis-server --save ""
deploy:
restart_policy:
condition: any
networks:
- redis_server_lu

Expand Down