From e3b406c627c33716fa2c15bbe0226b2c2fb0bb80 Mon Sep 17 00:00:00 2001 From: SamR1 Date: Sat, 13 Jan 2018 11:05:23 +0100 Subject: [PATCH] docker-compose-ci.yml update docker-compose-ci.yml update --- .travis.yml | 8 +++++--- docker-compose-ci.yml | 15 ++++++++------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8716e85c..944807d1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,13 +14,15 @@ before_install: - sudo mv docker-compose /usr/local/bin before_script: - - export APP_SETTINGS="project.config.TestingConfig" - - export DATABASE_TEST_URL=postgresql://postgres:@localhost/users_test - - export REACT_APP_USERS_SERVICE_URL=http://127.0.0.1:3000/api/ + - export DATABASE_TEST_URL=postgres://postgres:@localhost:5432/mpwo_test + - export APP_SETTINGS=mpwo_api.config.TestingConfig + - export REACT_APP_USERS_SERVICE_URL=http://localhost:3000/api/ - docker-compose -f docker-compose-ci.yml up --build -d script: - psql -c 'create database mpwo_test;' -U postgres + - echo $DATABASE_TEST_URL + - psql -c '\list' -U postgres - docker-compose -f docker-compose-ci.yml run api flask init_db after_script: diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml index 12f4d21a..9890452f 100644 --- a/docker-compose-ci.yml +++ b/docker-compose-ci.yml @@ -2,14 +2,14 @@ version: '3.3' services: - db: - container_name: db + api-db: + container_name: api-db build: https://github.com/SamR1/mpwo.git#master:mpwo_api/db ports: - 5435:5432 environment: - - POSTGRES_USER=mpwo - - POSTGRES_PASSWORD=mpwo + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=postgres api: container_name: api @@ -19,14 +19,15 @@ services: ports: - 5001:5000 environment: + - DATABASE_URL=postgres://postgres:postgres@api-db:5432/mpwo + - DATABASE_TEST_URL=postgres://postgres:postgres@api-db:5432/mpwo_test - FLASK_APP=server.py - FLASK_DEBUG=1 - APP_SETTINGS=mpwo_api.config.TestingConfig - - DATABASE_URL=postgres://mpwo:mpwo@db:5432/mpwo_test depends_on: - - db + - api-db links: - - db + - api-db client: container_name: client