2018-04-16 14:01:57 +00:00
|
|
|
FROM eu.gcr.io/avatao-challengestore/tutorial-framework
|
2018-03-23 14:27:42 +00:00
|
|
|
|
2018-04-28 13:51:04 +00:00
|
|
|
# Install webservice dependencies
|
|
|
|
RUN pip3 install Flask==1.0 \
|
|
|
|
SQLAlchemy==1.2.7
|
|
|
|
|
2018-04-25 09:52:42 +00:00
|
|
|
# Define variables to use later
|
2018-04-19 15:33:12 +00:00
|
|
|
ENV TFW_SERVER_DIR="/srv/.tfw" \
|
2018-04-28 13:51:04 +00:00
|
|
|
TFW_WEBSERVICE_DIR="/srv/login_service" \
|
2018-04-25 09:52:42 +00:00
|
|
|
TFW_IDE_WD="/home/${AVATAO_USER}/workdir" \
|
2018-03-23 14:27:42 +00:00
|
|
|
TFW_TERMINADO_WD="/home/${AVATAO_USER}/workdir"
|
|
|
|
|
2018-04-25 09:52:42 +00:00
|
|
|
# Copy TFW related stuff to a dedicated directory
|
2018-04-19 15:33:12 +00:00
|
|
|
COPY solvable/src ${TFW_SERVER_DIR}/
|
2018-03-23 14:27:42 +00:00
|
|
|
|
2018-04-25 09:52:42 +00:00
|
|
|
# Copy webservice to a dedicated directory
|
2018-04-26 09:04:00 +00:00
|
|
|
COPY solvable/src/webservice/ ${TFW_WEBSERVICE_DIR}/
|
|
|
|
ADD solvable/src/webservice/frontend-deps.tar ${TFW_WEBSERVICE_DIR}/static
|
2018-03-23 14:27:42 +00:00
|
|
|
|
2018-04-26 09:04:00 +00:00
|
|
|
# Create IDE directory, symlink server source and give proper permissions to AVATAO_USER
|
2018-04-25 09:52:42 +00:00
|
|
|
RUN mkdir -p ${TFW_IDE_WD} &&\
|
2018-04-26 09:04:00 +00:00
|
|
|
ln -s ${TFW_WEBSERVICE_DIR}/server.py ${TFW_IDE_WD} &&\
|
2018-04-25 09:52:42 +00:00
|
|
|
chown -R ${AVATAO_USER}: ${TFW_IDE_WD} && chmod -R 755 ${TFW_IDE_WD}
|
|
|
|
|
|
|
|
# Hide TFW related code from user
|
|
|
|
RUN chown -R root:root ${TFW_SERVER_DIR} && chmod -R 700 ${TFW_SERVER_DIR}
|
|
|
|
|
|
|
|
# Make AVATAO_USER's home writeable and set it as WORKDIR
|
2018-03-23 14:27:42 +00:00
|
|
|
VOLUME ["/home/${AVATAO_USER}"]
|
|
|
|
WORKDIR /home/${AVATAO_USER}
|