summaryrefslogtreecommitdiff
path: root/core/Dockerfile
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-06-29 16:06:35 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-08-24 16:04:00 +0200
commit4a79cefdf5d71715b6c575d5c8bb4fea418c2ba6 (patch)
treefc68847d1e010e2962dac8345a0fd0cc9a2f0681 /core/Dockerfile
parentad31b66503ec65e611ab96c2a540180ed25f5a6f (diff)
Prepare opendc repository for monorepo
This change prepares the opendc repository for a monorepo setup by moving all files to the core/ directory. After all repositories have been merged into this repository, we will move the correct files back.
Diffstat (limited to 'core/Dockerfile')
-rw-r--r--core/Dockerfile35
1 files changed, 35 insertions, 0 deletions
diff --git a/core/Dockerfile b/core/Dockerfile
new file mode 100644
index 00000000..f7f36d87
--- /dev/null
+++ b/core/Dockerfile
@@ -0,0 +1,35 @@
+FROM node:14.2.0
+MAINTAINER Sacheendra Talluri <sacheendra.t@gmail.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
+
+# 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/*
+
+# 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 \
+ && 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']") \
+ && yarn build
+
+# Set working directory
+WORKDIR /opendc
+
+CMD ["sh", "-c", "./build/configure.sh && python3 opendc-web-server/main.py keys.json"]