summaryrefslogtreecommitdiff
path: root/Dockerfile
blob: 32b790c55d2f4c0c450cac08fdbfee77d15f3230 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
FROM node:14.2.0
MAINTAINER Sacheendra Talluri <sacheendra.t@gmail.com>

# 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 mysql-client \
	&& 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 && python2.7 opendc-web-server/main.py keys.json"]