mirror of https://github.com/rhaamo/camgear
3 changed files with 50 additions and 0 deletions
@ -0,0 +1,38 @@ |
|||
FROM alpine:3.10 |
|||
|
|||
ADD ./ /app/ |
|||
|
|||
RUN \ |
|||
echo 'installing dependencies' && \ |
|||
apk add --no-cache \ |
|||
bash \ |
|||
git \ |
|||
musl-dev \ |
|||
gcc \ |
|||
postgresql-dev \ |
|||
python3-dev \ |
|||
py3-psycopg2 \ |
|||
make \ |
|||
zlib-dev \ |
|||
jpeg-dev \ |
|||
libmagic \ |
|||
&& \ |
|||
ln -s /usr/bin/python3 /usr/bin/python |
|||
|
|||
# hack around https://github.com/pypa/pip/issues/6158#issuecomment-456619072 |
|||
ENV PIP_DOWNLOAD_CACHE=/noop/ |
|||
RUN \ |
|||
echo 'installing pip requirements' && \ |
|||
pip3 install --upgrade pip && \ |
|||
pip3 install setuptools wheel && \ |
|||
pip3 install -r /app/requirements.txt && \ |
|||
rm -rf $PIP_DOWNLOAD_CACHE |
|||
|
|||
RUN mkdir /uploads /statics |
|||
VOLUME /uploads |
|||
VOLUME /statics |
|||
|
|||
EXPOSE 8000 |
|||
WORKDIR /app/ |
|||
ENTRYPOINT ["./docker/entrypoint.sh"] |
|||
CMD ["./docker/server.sh"] |
@ -0,0 +1,7 @@ |
|||
#!/bin/sh |
|||
set -e |
|||
|
|||
export STATIC_ROOT=/statics |
|||
export MEDIA_ROOT=/uploads |
|||
|
|||
exec "$@" |
@ -0,0 +1,5 @@ |
|||
#!/bin/bash -eux |
|||
python /app/manage.py collectstatic --noinput |
|||
python /app/manage.py migrate |
|||
cd /app/ |
|||
gunicorn --log-file=- --worker-tmp-dir /dev/shm config.asgi:application -w ${CAMGEAR_WEB_WORKERS-2} --threads ${CAMGEAR_WEB_THREADS-4} -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 ${GUNICORN_ARGS-} |
Loading…
Reference in new issue