Spaces:
Sleeping
Sleeping
File size: 701 Bytes
0841c28 |
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 |
FROM python:3.10-slim
#Install cron and git
RUN apt-get update
RUN apt-get -y install cron git
# prepare scripts
WORKDIR /app/
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY ./scripts/ /app/scripts/
RUN bash scripts/get_aclanthology.sh
COPY ./src/ /app/src/
COPY ./index.html /app/index.html
COPY ./server.py /app/server.py
# Add the cron job
RUN crontab -l | { cat; echo "*/10 * * * * bash /app/scripts/clean_tmp.sh"; } | crontab -
RUN crontab -l | { cat; echo "0 0 * * * bash /app/scripts/get_aclanthology.sh"; } | crontab -
# Run the command on container startup
CMD cron
# start service
EXPOSE 7860
CMD ["python", "-u", "server.py"]
|