Commit 5c0ffe4c authored by Aanand Prasad's avatar Aanand Prasad
Browse files

Consolidate dev config in docker-compose.yml, remove docker-compose.override.yml

parent b18d9b67
Pipeline #4060 passed with stages
in 2 minutes and 27 seconds
......@@ -14,6 +14,8 @@ It uses Rails 5 in API version.
Follow [the official instructions](https://docs.docker.com/compose/install/) for installation of Docker and Docker Compose.
(optional) If your INK steps have Docker dependencies, add those services to a `docker-compose.override.yml` file in this directory.
Run `docker volume create --name=gems` to create a Docker volume for storing the Ruby gem dependencies outside the container.
Run `docker-compose up` to start the app.
......
version: '3'
services:
sidekiq:
build: .
env_file:
- '.env.sample'
environment:
# override rails_env through shell
- RAILS_ENV
depends_on:
- postgres
- redis
- slanger
- ink
volumes:
- ink-api-files-volume:/ink-api/ink_api_files
command: ['./bin/wait-for-it', 'postgres:5432', '-s', '-t', '40', '--', './bin/bundle', 'exec', 'sidekiq']
slanger:
image: inkmap/slanger:1.0.3
env_file:
- '.env.sample'
ports:
- 4567:4567
- 8080:8080
depends_on:
- redis
seed_db:
build: .
env_file:
- '.env.sample'
environment:
# override rails_env through shell
- RAILS_ENV
depends_on:
- postgres
- redis
- slanger
command: ['./bin/wait-for-it', 'postgres:5432', '-s', '-t', '40', '--', './bin/seed-db']
ink:
build: .
env_file:
- '.env.sample'
environment:
# override rails_env through shell
- RAILS_ENV
depends_on:
- postgres
- redis
- slanger
- seed_db
ports:
- 3000:3000
volumes:
- .:/app
- gems:/gems
- ink-api-files-volume:/ink-api/ink_api_files
command: ['./bin/wait-for-it', 'seed_db:1234', '-s', '-t', '100', '--', './bin/start']
volumes:
gems:
# Flagging this as "external" means it will use the volume named "gems" on the host instead of making a new volume specific to this docker-compose file
external: true
version: '3'
services:
postgres:
image: postgres:9.5
ink:
build: .
env_file:
- '.env.sample'
environment:
# override rails_env through shell
- RAILS_ENV
depends_on:
- postgres
- redis
- RAILS_ENV=test
entrypoint: ['./bin/wait-for-it', 'postgres:5432', '-s', '-t', '40', '--', './bin/test']
......@@ -15,7 +15,69 @@ services:
volumes:
- redis-volume:/var/lib/redis/data
slanger:
image: inkmap/slanger:1.0.3
env_file:
- '.env.sample'
ports:
- 4567:4567
- 8080:8080
depends_on:
- redis
sidekiq:
build: .
env_file:
- '.env.sample'
environment:
# override rails_env through shell
- RAILS_ENV
depends_on:
- postgres
- redis
- slanger
- ink
volumes:
- ink-api-files-volume:/ink-api/ink_api_files
command: ['./bin/wait-for-it', 'postgres:5432', '-s', '-t', '40', '--', './bin/bundle', 'exec', 'sidekiq']
seed_db:
build: .
env_file:
- '.env.sample'
environment:
# override rails_env through shell
- RAILS_ENV
depends_on:
- postgres
- redis
- slanger
command: ['./bin/wait-for-it', 'postgres:5432', '-s', '-t', '40', '--', './bin/seed-db']
ink:
build: .
env_file:
- '.env.sample'
environment:
# override rails_env through shell
- RAILS_ENV
depends_on:
- postgres
- redis
- slanger
- seed_db
ports:
- 3000:3000
volumes:
- .:/app
- gems:/gems
- ink-api-files-volume:/ink-api/ink_api_files
command: ['./bin/wait-for-it', 'seed_db:1234', '-s', '-t', '100', '--', './bin/start']
volumes:
redis-volume:
postgres-volume:
gems:
# Flagging this as "external" means it will use the volume named "gems" on the host instead of making a new volume specific to this docker-compose file
external: true
ink-api-files-volume:
#!/usr/bin/env bash
set -e
export COMPOSE_FILE=docker-compose.yml:docker-compose.test.yml
export RAILS_ENV=test
export COMPOSE_PROJECT_NAME=inkapi_test
export COMPOSE_FILE=docker-compose.test.yml
docker-compose up -d postgres redis
docker-compose up -d postgres
docker-compose run -v "$PWD:/app" -v "gems:/gems" ink "$@"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment