mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-25 15:59:38 +02:00
Add CZ and CRON for worldtravel seed
This commit is contained in:
parent
02fe21c723
commit
df1fda4ce6
2 changed files with 16 additions and 4 deletions
|
@ -13,7 +13,7 @@ WORKDIR /code
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y git postgresql-client \
|
&& apt-get install -y git postgresql-client cron \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
|
@ -24,9 +24,22 @@ RUN pip install -r requirements.txt
|
||||||
# Copy the Django project code into the Docker image
|
# Copy the Django project code into the Docker image
|
||||||
COPY ./server /code/
|
COPY ./server /code/
|
||||||
|
|
||||||
RUN python3 manage.py collectstatic --verbosity 2
|
# Collect static files
|
||||||
|
RUN python3 manage.py collectstatic --noinput --verbosity 2
|
||||||
|
|
||||||
|
# Setup cron to run python3 manage.py worldtravel-seed every day at 00:00
|
||||||
|
RUN echo "0 0 * * * python3 /code/manage.py worldtravel-seed --force >> /var/log/cron.log 2>&1" > /etc/cron.d/worldtravel-seed
|
||||||
|
|
||||||
|
# Give execution rights on the cron job
|
||||||
|
RUN chmod 0644 /etc/cron.d/worldtravel-seed
|
||||||
|
|
||||||
|
# Apply cron job
|
||||||
|
RUN crontab /etc/cron.d/worldtravel-seed
|
||||||
|
|
||||||
|
# Ensure cron is started in the foreground when the container starts
|
||||||
|
CMD ["cron", "-f"]
|
||||||
|
|
||||||
# Set the entrypoint script
|
# Set the entrypoint script
|
||||||
COPY ./entrypoint.sh /code/entrypoint.sh
|
COPY ./entrypoint.sh /code/entrypoint.sh
|
||||||
RUN chmod +x /code/entrypoint.sh
|
RUN chmod +x /code/entrypoint.sh
|
||||||
ENTRYPOINT ["/code/entrypoint.sh"]
|
ENTRYPOINT ["/code/entrypoint.sh"]
|
||||||
|
|
|
@ -524,7 +524,6 @@ class Command(BaseCommand):
|
||||||
('IS-6', 'Norðurland eystra', 'is'),
|
('IS-6', 'Norðurland eystra', 'is'),
|
||||||
('IS-7', 'Austurland', 'is'),
|
('IS-7', 'Austurland', 'is'),
|
||||||
('IS-8', 'Suðurland', 'is'),
|
('IS-8', 'Suðurland', 'is'),
|
||||||
('CZ-10', 'Prague', 'cz'),
|
|
||||||
('CZ-20', 'Středočeský kraj', 'cz'),
|
('CZ-20', 'Středočeský kraj', 'cz'),
|
||||||
('CZ-31', 'Jihočeský kraj', 'cz'),
|
('CZ-31', 'Jihočeský kraj', 'cz'),
|
||||||
('CZ-32', 'Plzeňský kraj', 'cz'),
|
('CZ-32', 'Plzeňský kraj', 'cz'),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue