diff options
| -rw-r--r-- | Dockerfile | 13 | ||||
| -rw-r--r-- | docker-compose.yml | 76 | ||||
| m--------- | opendc-frontend | 13 | ||||
| m--------- | opendc-simulator | 46 | ||||
| m--------- | opendc-web-server | 10 |
5 files changed, 82 insertions, 76 deletions
@@ -1,12 +1,10 @@ FROM node:7.4 MAINTAINER Sacheendra Talluri <sacheendra.t@gmail.com> -# Installing python, yarn, and web-server dependencies -RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ - && echo "deb http://ftp.debian.org/debian stretch main" >> /etc/apt/sources.list \ +# Installing python and web-server dependencies +RUN echo "deb http://ftp.debian.org/debian stretch main" >> /etc/apt/sources.list \ && apt-get update \ - && apt-get install -y python python-pip yarn git sed supervisor openjdk-8-jdk mysql-client \ + && apt-get install -y python python-pip yarn git sed mysql-client \ && pip install oauth2client eventlet flask-socketio flask-compress mysql-connector-python-rf \ && rm -rf /var/lib/apt/lists/* @@ -22,4 +20,7 @@ RUN chmod 555 /opendc/build/configure.sh \ && 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 -CMD ["sh", "-c", "cd /opendc && ./build/configure.sh && /usr/bin/supervisord -c /opendc/build/supervisord.conf"] +# Set working directory +WORKDIR /opendc + +CMD ["sh", "-c", "./build/configure.sh && python2.7 opendc-web-server/main.py keys.json"] diff --git a/docker-compose.yml b/docker-compose.yml index d1c9c1f7..ac4bc27f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,33 +1,43 @@ -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:
- - PERSISTENCE_URL=jdbc:mysql://mariadb:3306/opendc
- - PERSISTENCE_USER=opendc
- - PERSISTENCE_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: + frontend: + build: ./ + image: frontend + restart: on-failure + ports: + - "8081:8081" + links: + - mariadb + depends_on: + - mariadb + environment: + - MYSQL_DATABASE=opendc + - MYSQL_USER=opendc + - MYSQL_PASSWORD=opendcpassword + simulator: + build: + context: ./opendc-simulator + dockerfile: opendc-integration-jpa/mysql/Dockerfile + image: simulator + restart: on-failure + links: + - mariadb + depends_on: + - mariadb + environment: + - PERSISTENCE_URL=jdbc:mysql://mariadb:3306/opendc + - PERSISTENCE_USER=opendc + - PERSISTENCE_PASSWORD=opendcpassword + mariadb: + image: mariadb:10.1 + restart: on-failure + 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-frontend b/opendc-frontend -Subproject 194b0125d44ed960ba4d2e79bfc64633d92e1c2 +Subproject bcf119f2c4ac587cc8263db8a9fc0581521fdec diff --git a/opendc-simulator b/opendc-simulator -Subproject 25cc35b0e4942e990c01ac6224720e8fe84fd9a +Subproject 8666a78b86a40c1d8dab28dd18e841318c01f97 diff --git a/opendc-web-server b/opendc-web-server -Subproject cb4eafa88edd4db36f34185c9477e84346bece6 +Subproject b87faa0bccf661a2b6a948d9420d52a19a63d9a |
