You've already forked snikket-web-portal
[Docker] Add Dockerfile
This commit is contained in:
35
docker/Dockerfile
Normal file
35
docker/Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
FROM python:3.7-slim-buster
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
make \
|
||||
&& apt-get clean
|
||||
|
||||
COPY Makefile /opt/snikket-web-portal/Makefile
|
||||
|
||||
COPY requirements.txt /opt/snikket-web-portal/requirements.txt
|
||||
|
||||
COPY build-requirements.txt /opt/snikket-web-portal/build-requirements.txt
|
||||
|
||||
COPY snikket_web/ /opt/snikket-web-portal/snikket_web
|
||||
|
||||
COPY babel.cfg /opt/snikket-web-portal/babel.cfg
|
||||
|
||||
COPY web_config.production.py /opt/snikket-web-portal/.local/web_config.py
|
||||
|
||||
WORKDIR /opt/snikket-web-portal
|
||||
|
||||
RUN pip install -r requirements.txt \
|
||||
&& pip install -r build-requirements.txt
|
||||
|
||||
RUN make
|
||||
|
||||
ENV SNIKKET_WEB_CONFIG "/opt/snikket-web-portal/.local/web_config.py"
|
||||
|
||||
RUN pip install hypercorn
|
||||
|
||||
ADD docker/entrypoint.sh /bin/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/bin/sh", "/bin/entrypoint.sh"]
|
||||
17
docker/entrypoint.sh
Normal file
17
docker/entrypoint.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$SNIKKET_DOMAIN" ]; then
|
||||
echo "Please provide SNIKKET_DOMAIN";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ -z "$PROSODY_ENDPOINT" ]; then
|
||||
echo "Please provide PROSODY_ENDPOINT";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ -z "$SECRET_KEY" ]; then
|
||||
echo "Please provide SECRET_KEY";
|
||||
fi
|
||||
|
||||
exec hypercorn -b "0.0.0.0:8000" snikket_web:app
|
||||
Reference in New Issue
Block a user