From 55c3c489c04bb002c6bd705f5dac5c580fb8f102 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Fri, 29 Sep 2017 09:51:01 +0200 Subject: Connect docker-compose with new simulator image --- Dockerfile | 6 ++--- build/supervisord.conf | 27 ++++++++--------------- docker-compose.yml | 60 +++++++++++++++++++++++++++----------------------- opendc-simulator | 2 +- 4 files changed, 45 insertions(+), 50 deletions(-) diff --git a/Dockerfile b/Dockerfile index 12c2f4d2..49c82935 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,13 +15,11 @@ COPY ./ /opendc # Setting up simulator RUN chmod 555 /opendc/build/configure.sh \ - && cd /opendc/opendc-simulator \ - && ./gradlew build \ && cd /opendc/opendc-frontend \ && rm -rf ./build \ && rm -rf ./node_modules \ - && npm install \ + && yarn \ && export REACT_APP_OAUTH_CLIENT_ID=$(cat ../keys.json | python -c "import sys, json; print json.load(sys.stdin)['OAUTH_CLIENT_ID']") \ - && npm run build + && yarn build CMD ["sh", "-c", "cd /opendc && ./build/configure.sh && /usr/bin/supervisord -c /opendc/build/supervisord.conf"] diff --git a/build/supervisord.conf b/build/supervisord.conf index ff4556a4..cfb671d6 100644 --- a/build/supervisord.conf +++ b/build/supervisord.conf @@ -1,18 +1,9 @@ -[supervisord] -nodaemon=true - -[program:web-server] -command=/usr/bin/python2.7 /opendc/opendc-web-server/main.py /opendc/keys.json -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:simulator] -directory=/opendc/opendc-simulator/opendc-integration-jpa -command=/opendc/opendc-simulator/gradlew run -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - +[supervisord] +nodaemon=true + +[program:web-server] +command=/usr/bin/python2.7 /opendc/opendc-web-server/main.py /opendc/keys.json +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/docker-compose.yml b/docker-compose.yml index 4b757efe..f1fa0ae7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,27 +1,33 @@ -version: "2" -services: - opendc: - build: ./ - image: opendc - ports: - - "8081:8081" - links: - - mariadb - depends_on: - - mariadb - environment: - - MYSQL_DATABASE=opendc - - MYSQL_USER=opendc - - MYSQL_PASSWORD=opendcpassword - mariadb: - image: mariadb:10.1 - ports: - - "3306:3306" # comment this line out in production - environment: - - MYSQL_DATABASE=opendc - - MYSQL_USER=opendc - - MYSQL_PASSWORD=opendcpassword - - MYSQL_RANDOM_ROOT_PASSWORD=yes - # uncomment in production - # volumes: - # - "/data/mariadb:/var/lib/mysql" +version: "2" +services: + opendc: + build: ./ + image: opendc + ports: + - "8081:8081" + links: + - mariadb + depends_on: + - mariadb + environment: + - MYSQL_DATABASE=opendc + - MYSQL_USER=opendc + - MYSQL_PASSWORD=opendcpassword + opendc-simulator: + build: ./opendc-simulator + environment: + - MYSQL_DATABASE=opendc + - MYSQL_USER=opendc + - MYSQL_PASSWORD=opendcpassword + mariadb: + image: mariadb:10.1 + ports: + - "3306:3306" # comment this line out in production + environment: + - MYSQL_DATABASE=opendc + - MYSQL_USER=opendc + - MYSQL_PASSWORD=opendcpassword + - MYSQL_RANDOM_ROOT_PASSWORD=yes + # uncomment in production + # volumes: + # - "/data/mariadb:/var/lib/mysql" diff --git a/opendc-simulator b/opendc-simulator index 22547de4..6c78d011 160000 --- a/opendc-simulator +++ b/opendc-simulator @@ -1 +1 @@ -Subproject commit 22547de46abf1e0ab517657e2727b0eeaddeeaa0 +Subproject commit 6c78d011f735d14ac45f7eae9ab0d56fd17cc55e -- cgit v1.2.3