-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 916 Bytes
/
Dockerfile
File metadata and controls
37 lines (28 loc) · 916 Bytes
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
FROM python:3.10-slim
# Instalar dependências do sistema para psycopg2
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Variáveis de ambiente
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PORT=8000
# Instalar dependências do sistema
RUN apt-get update && apt-get install -y \
gcc \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
# Copie os arquivos de requirements e instale as dependências
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Coletar arquivos estáticos (importante para Django)
RUN python manage.py collectstatic --noinput
# Exponha a porta que o Django vai rodar
EXPOSE 8000
# Comando para rodar o servidor Django com Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "argus_ia.wsgi:application"]