-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (21 loc) · 901 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# syntax=docker/dockerfile:1
FROM python:3.6
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN useradd -ms /bin/bash python
WORKDIR /home/python/code
COPY requirements.txt /home/python/code/
RUN apt-get update && apt-get install -y g++ gcc musl-dev libpq-dev && \
pip3 install --upgrade pip setuptools && \
pip3 install -r requirements.txt --no-cache-dir && \
rm -rf /var/lib/{apt,dpkg,cache,log}/
COPY . .
ENV DJANGO_SUPERUSER_USERNAME=hyperdx
ENV DJANGO_SUPERUSER_PASSWORD=password
RUN python manage.py migrate && \
python manage.py collectstatic --noinput && \
python manage.py createsuperuser --no-input && \
opentelemetry-bootstrap --action=install
CMD [ "opentelemetry-instrument", "gunicorn", "mysite.wsgi", "-c", "gunicorn.config.py", "--workers", "2", "--threads", "2", "--reload", "--bind", "0.0.0.0:8000" ]
EXPOSE 8000