Add entrypoint script
This commit is contained in:
+6
-2
@@ -18,5 +18,9 @@ RUN apk add --no-cache --virtual .build-deps python3-dev build-base linux-header
|
|||||||
&& pip install -r requirements.production.txt \
|
&& pip install -r requirements.production.txt \
|
||||||
&& apk del .build-deps
|
&& apk del .build-deps
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "-c", "echo 'Django running on http://localhost:8000 in production mode' \
|
RUN python manage.py collectstatic --noinput
|
||||||
&& gunicorn -w 4 -b 0.0.0.0:8000 sikweb.wsgi"]
|
|
||||||
|
# run migrate
|
||||||
|
# python manage.py migrate --noinput
|
||||||
|
|
||||||
|
ENTRYPOINT ["sh", "-c", "./production_entrypoint.sh"]
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Collect static files
|
||||||
|
echo "Collect static files"
|
||||||
|
python manage.py collectstatic --noinput
|
||||||
|
|
||||||
|
# Apply database migrations
|
||||||
|
echo "Apply database migrations"
|
||||||
|
python manage.py migrate
|
||||||
|
|
||||||
|
# Start server
|
||||||
|
echo "Django running on http://localhost:8000 in production mode"
|
||||||
|
gunicorn -w 4 -b 0.0.0.0:8000 sikweb.wsgi
|
||||||
Reference in New Issue
Block a user