Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
perduta committed Mar 3, 2018
1 parent bbfe252 commit 0dba38c
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
6 changes: 4 additions & 2 deletions compose/django/Dockerfile-dev
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ COPY ./compose/django/start-dev.sh /start-dev.sh
RUN sed -i 's/\r//' /start-dev.sh
RUN chmod +x /start-dev.sh

COPY ./compose/django/start-cron-dev.sh /start-cron-dev.sh
RUN chmod +x /start-cron-dev.sh

ADD chroniker_crontab /etc/cron.d/chroniker-cron
RUN chmod 0644 /etc/cron.d/chroniker-cron
COPY ./compose/django/cron.sh /cron.sh
RUN chmod +x /cron.sh

WORKDIR /app

Expand Down
6 changes: 6 additions & 0 deletions compose/django/cron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set -a
. /app/.env.local
set +a

/usr/local/bin/chroniker -p /app/ -s settings.test
#python /app/manage.py cron
3 changes: 3 additions & 0 deletions compose/django/start-cron-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
echo '* * * * * root /cron.sh >> /var/log/cron.log 2>&1' > /etc/cron.d/manage-py-cron
cron -f
1 change: 0 additions & 1 deletion compose/django/start-dev.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
./bin/sass_watch.sh &
cron -f&
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
16 changes: 16 additions & 0 deletions dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,21 @@ services:
env_file:
- .env.local

django-chroniker:
build:
context: .
dockerfile: ./compose/django/Dockerfile-dev
command: /start-cron-dev.sh
depends_on:
- postgres
- redis
- django
volumes:
- .:/app
links:
- postgres
env_file:
- .env.local

redis:
build: ./compose/redis

0 comments on commit 0dba38c

Please sign in to comment.