9 changed files with 69 additions and 6 deletions
@ -0,0 +1,19 @@
|
||||
FROM python:3.8.5-slim |
||||
|
||||
RUN mkdir /app && mkdir /db |
||||
WORKDIR /app |
||||
COPY requirements.txt ./ |
||||
RUN pip install -r requirements.txt |
||||
COPY manage.py ./ |
||||
COPY articles ./articles/ |
||||
COPY blog ./blog/ |
||||
COPY docker ./docker/ |
||||
|
||||
ENV SECRET_KEY "changeme" |
||||
ENV DEBUG "false" |
||||
ENV HOST "" |
||||
ENV DB_BASE_DIR "/db" |
||||
|
||||
HEALTHCHECK --start-period=30s CMD curl -f http://localhost:8000 |
||||
|
||||
CMD ["/app/docker/run.sh"] |
@ -0,0 +1,15 @@
|
||||
version: '2.4' |
||||
services: |
||||
django: |
||||
image: crocmagnon/blog |
||||
build: . |
||||
ports: |
||||
- 8000:8000 |
||||
env_file: |
||||
- .env |
||||
volumes: |
||||
- ./db:/db |
||||
# - /srv/blog/db:/db |
||||
- ./static:/app/static |
||||
# - /srv/blog/static:/app/static |
||||
restart: on-failure |
@ -0,0 +1,5 @@
|
||||
#!/bin/sh |
||||
yes yes | python manage.py migrate && \ |
||||
#yes yes | pipenv run python manage.py createcachetable && \ |
||||
python manage.py collectstatic --noinput && \ |
||||
gunicorn blog.wsgi -b 0.0.0.0:8000 --log-file - |
Loading…
Reference in new issue