Skip to content

Commit

Permalink
Create directories on app starting and some clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
xcompass committed Oct 9, 2024
1 parent bc8937e commit 90fbb68
Show file tree
Hide file tree
Showing 6 changed files with 875 additions and 799 deletions.
23 changes: 14 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
# ======================================================================
# Container Choice
FROM python:3.11-slim
ENV LANG C.UTF-8
ENV LANG=C.UTF-8
# TimeZone Settings
ENV TZ 'America/Vancouver'
ENV TZ='America/Vancouver'
ENV WAITRESS_PORT=5000
ENV WAITRESS_HOST=0.0.0.0
RUN echo $TZ > /etc/timezone && \
apt-get update && apt-get install -y tzdata && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean
apt-get update && apt-get install -y tzdata && \
rm /etc/localtime && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
apt-get clean

# Package Installation Command
RUN apt-get update && \
SYSTEM_PACKAGES=noninteractive apt-get install -y \
Expand All @@ -36,8 +39,10 @@ RUN apt-get update && \
# ----------------------------------------------------------------------

EXPOSE 5000
COPY usr/share/jupyter-canvas-api/api-server.py /usr/share/jupyter-canvas-api/api-server.py
COPY usr/share/jupyter-canvas-api/api_server.py /usr/share/jupyter-canvas-api/api_server.py
COPY usr/share/jupyter-canvas-api/wsgi.py /usr/share/jupyter-canvas-api/wsgi.py
COPY usr/share/jupyter-canvas-api/requirements.txt /usr/share/jupyter-canvas-api/requirements.txt
COPY usr/share/jupyter-canvas-api/run.sh /usr/share/jupyter-canvas-api/run.sh
COPY usr/local/bin/hourly-rsync.sh /etc/cron.hourly/hourly-api-rsync
COPY docker-entrypoint.sh /
RUN mkdir /mnt/efs
Expand All @@ -46,4 +51,4 @@ RUN touch /etc/crontab /etc/cron.*/*
WORKDIR /usr/share/jupyter-canvas-api/
RUN pip3 install -r /usr/share/jupyter-canvas-api/requirements.txt
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD printenv | grep -v "no_proxy" > /etc/environment && /etc/init.d/cron start && python3 -u /usr/share/jupyter-canvas-api/api-server.py
CMD ["/usr/share/jupyter-canvas-api/run.sh"]
5 changes: 5 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ export JNOTE_HOME="${JNOTE_HOME:-$DEFAULT_JNOTE_HOME}"
export JNOTE_SNAP="${JNOTE_SNAP:-$DEFAULT_JNOTE_SNAP}"
export JNOTE_INTSNAP="${JNOTE_INTSNAP:-$DEFAULT_JNOTE_INTSNAP}"

DEFAULT_MODULE_NAME=wsgi
MODULE_NAME=${MODULE_NAME:-$DEFAULT_MODULE_NAME}
VARIABLE_NAME=${VARIABLE_NAME:-application}
export APP_MODULE=${APP_MODULE:-"$MODULE_NAME:$VARIABLE_NAME"}

exec "$@"
Loading

0 comments on commit 90fbb68

Please sign in to comment.