diff options
| author | jc0b <j@jc0b.computer> | 2020-06-30 18:02:16 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 19:44:37 +0200 |
| commit | b97d1977d08760b237c645a275be1972a32451b7 (patch) | |
| tree | 55cfdd69a8237411558a3045c9342a014de607f1 /Dockerfile | |
| parent | 6a4703517e7e1ca5ee2c8d8e0a4c49f32d17c662 (diff) | |
| parent | abb91a93c40ef3577aa953cf6e8c252593e082d4 (diff) | |
Merge branch 'feature/mongodb-migration' of github.com:atlarge-research/opendc-dev into feature/mongodb-migration
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 35 |
1 files changed, 13 insertions, 22 deletions
@@ -1,35 +1,26 @@ -FROM node:14.2.0 -MAINTAINER Sacheendra Talluri <sacheendra.t@gmail.com> +FROM nikolaik/python-nodejs:python3.8-nodejs14 +MAINTAINER OpenDC Maintainers <opendc@atlarge-research.com> -# Adding the mongodb repo and installing the client -RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add - \ - && echo "deb http://repo.mongodb.org/apt/debian stretch/mongodb-org/4.2 main" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list \ - && apt-get update \ - && apt-get install -y mongodb-org +## Dockerfile for the frontend/server part of the deployment -# 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 python3 python3-pip yarn git sed mysql-client pymongo \ - && pip3 install oauth2client eventlet flask-socketio flask-compress mysql-connector-python-rf \ - && pip3 install --upgrade pyasn1-modules \ - && rm -rf /var/lib/apt/lists/* +# Installing packages +RUN apt-get update \ + && apt-get install -y yarn git sed # Copy OpenDC directory COPY ./ /opendc -# Setting up simulator -RUN pip install -e /opendc/opendc-web-server \ - && python /opendc/opendc-web-server/setup.py install \ - && chmod 555 /opendc/build/configure.sh \ - && cd /opendc/opendc-frontend \ +# Fetch web server dependencies +RUN pip install -r /opendc/web-server/requirements.txt + +# Build frontend +RUN cd /opendc/frontend \ && rm -rf ./build \ - && rm -rf ./node_modules \ && yarn \ - && export REACT_APP_OAUTH_CLIENT_ID=$(cat ../keys.json | python -c "import sys, json; print json.load(sys.stdin)['OAUTH_CLIENT_ID']") \ + && export REACT_APP_OAUTH_CLIENT_ID=$OPENDC_OAUTH_CLIENT_ID \ && yarn build # Set working directory WORKDIR /opendc -CMD ["sh", "-c", "./build/configure.sh && python3 opendc-web-server/main.py keys.json"] +CMD ["sh", "-c", "python web-server/main.py"] |
