Add docker healthcheck feature & move collectstatic into container (#276)
This commit is contained in:
parent
b7b0b0dad4
commit
b170cd2850
|
@ -17,6 +17,7 @@ COPY requirements.txt requirements.txt
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
|
netcat \
|
||||||
gcc \
|
gcc \
|
||||||
libc6-dev \
|
libc6-dev \
|
||||||
libpq-dev \
|
libpq-dev \
|
||||||
|
|
|
@ -49,6 +49,11 @@ services:
|
||||||
|
|
||||||
web:
|
web:
|
||||||
<<: *takahe-common
|
<<: *takahe-common
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nc", "-z", "-v", "localhost", "8000"]
|
||||||
|
interval: 20s
|
||||||
|
timeout: 60s
|
||||||
|
start_period: 15s
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
|
|
||||||
|
@ -58,7 +63,9 @@ services:
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
<<: *takahe-common
|
<<: *takahe-common
|
||||||
command: ["/takahe/manage.py", "migrate"]
|
restart: "no"
|
||||||
|
command: >
|
||||||
|
bash -c "/takahe/manage.py migrate && /takahe/manage.py collectstatic --noinput"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
internal_network:
|
internal_network:
|
||||||
|
|
Loading…
Reference in New Issue