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 \
|
2018-04-28 14:13:35 +00:00
|
|
|
SQLAlchemy==1.2.7 \
|
2018-05-11 15:46:15 +00:00
|
|
|
passlib==1.7.1 \
|
|
|
|
git+https://github.com/avatao-content/tfwconnector.git#subdirectory=python3
|
2018-04-28 13:51:04 +00:00
|
|
|
|
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-05-04 08:02:30 +00:00
|
|
|
TFW_WEBSERVICE_DIR="/srv/webservice" \
|
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-28 17:12:19 +00:00
|
|
|
ln -s ${TFW_WEBSERVICE_DIR}/user_ops.py ${TFW_IDE_WD} &&\
|
2018-05-11 15:46:15 +00:00
|
|
|
chown -R ${AVATAO_USER}: "${TFW_IDE_WD}" "${TFW_WEBSERVICE_DIR}" &&\
|
|
|
|
chmod -R 755 "${TFW_IDE_WD}" "${TFW_WEBSERVICE_DIR}"
|
2018-04-25 09:52:42 +00:00
|
|
|
|
|
|
|
# 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-05-07 11:39:38 +00:00
|
|
|
# Make webservice directory writable
|
|
|
|
VOLUME ["/home/${AVATAO_USER}", "${TFW_WEBSERVICE_DIR}"]
|
2018-03-23 14:27:42 +00:00
|
|
|
WORKDIR /home/${AVATAO_USER}
|