-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.eleicoes
63 lines (45 loc) · 1.48 KB
/
Dockerfile.eleicoes
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Build staticfiles
FROM node:18-alpine AS node-builder
WORKDIR /app
COPY . .
WORKDIR /app/tailwind
RUN npm i
RUN npm run page:build
RUN npm run admin:build
# Use an official Python runtime based on Debian 10 "buster" as a parent image.
FROM python:slim-buster
# Port used by this container to serve HTTP.
EXPOSE 8000
# Set environment variables.
# 1. Force Python stdout and stderr streams to be unbuffered.
# 2. Set PORT variable that is used by Gunicorn. This should match "EXPOSE"
# command.
ENV PYTHONUNBUFFERED=1 \
PORT=8000
# Install system packages required by Django CMS and Django.
RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-recommends \
build-essential \
cargo \
libssl-dev \
libffi-dev \
sox \
ffmpeg \
libcairo2 \
libcairo2-dev \
python3-dev \
git \
&& rm -rf /var/lib/apt/lists/*
# Install the application server.
RUN pip install uwsgi django-storages boto3 django-prometheus
# Install the project requirements.
COPY org_eleicoes/requirements.txt /
RUN pip install -r requirements.txt
# Use /app folder as a directory where the source code is stored.
WORKDIR /app
# Copy the source code of the project into the container.
COPY --from=node-builder /app ./
RUN python manage.py collectstatic --noinput --clear -i tailwindcss
# Runtime command that executes when "docker run" is called.
# Check traefik + etcd configs to running domains
ENV ENABLE_CHECK_TRAEFIK=True
CMD ["uwsgi", "--ini", "/app/wsgi.ini"]