mirror of
https://github.com/bellingcat/cisticola.git
synced 2026-06-08 03:18:34 +03:00
temporarily removed Dockerfile and crontab
This commit is contained in:
42
Dockerfile
42
Dockerfile
@@ -1,42 +0,0 @@
|
||||
FROM python:3.9-slim as base
|
||||
|
||||
# Setup env
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONFAULTHANDLER 1
|
||||
|
||||
|
||||
FROM base AS python-deps
|
||||
|
||||
# Install pipenv and compilation dependencies
|
||||
RUN pip install pipenv
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends gcc g++ git libpq-dev musl-dev
|
||||
|
||||
# Install python dependencies in /.venv
|
||||
COPY Pipfile .
|
||||
COPY Pipfile.lock .
|
||||
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
|
||||
|
||||
|
||||
FROM base AS runtime
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends cron libpq-dev
|
||||
|
||||
# Copy virtual env from python-deps stage
|
||||
COPY --from=python-deps /.venv /.venv
|
||||
ENV PATH="/.venv/bin:$PATH"
|
||||
|
||||
# Create and switch to a new user
|
||||
# RUN useradd --create-home appuser
|
||||
WORKDIR /root
|
||||
# USER appuser
|
||||
|
||||
# Install application into container
|
||||
COPY . .
|
||||
|
||||
RUN ./spacy_setup.sh
|
||||
|
||||
# Copy crontab and start cron in foreground mode
|
||||
COPY crontab /etc/crontabs/root
|
||||
CMD ["cron", "-f"]
|
||||
6
crontab
6
crontab
@@ -1,6 +0,0 @@
|
||||
0,10,20,30,40,50 * * * * cd /home/appuser; /usr/bin/flock -w 0 scraper.lock pipenv run python app.py scrape-channels > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
0 * * * * cd /home/appuser; /usr/bin/timeout -s 2 10800 /usr/bin/flock -w 0 transform.lock pipenv run python app.py transform > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
0 21 * * * cd /home/appuser; /usr/bin/timeout -s 2 10800 /usr/bin/flock -w 0 scraper.lock pipenv run python app.py channel-info > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
30 * * * * cd /home/appuser; /usr/bin/flock -w 0 transform.lock pipenv run python app.py transform-info > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
0 * * * * cd /home/appuser; /usr/bin/flock -w 0 sync.lock pipenv run python app.py sync-channels --gsheet https://docs.google.com/spreadsheets/d/1UnBxtRVkabKHkDUkLxtFOSIX9akytd-rZyV-H_K1PWg/edit > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
30 * * * * cd /home/appuser; /usr/bin/timeout -s 2 82800 pipenv run python app.py transform-media > /proc/1/fd/1 2>/proc/1/fd/2
|
||||
Reference in New Issue
Block a user