Skip to content

Commit 0b06b31

Browse files
Update Dockerfile for Django application setup
1 parent d122374 commit 0b06b31

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

Dockerfile

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
1+
# Use uma imagem oficial do Python
12
FROM python:3.10-slim
23

3-
# Instalar dependências do sistema para psycopg2
4-
RUN apt-get update && apt-get install -y \
5-
gcc \
6-
postgresql-client \
7-
libpq-dev \
8-
&& rm -rf /var/lib/apt/lists/*
9-
4+
# Defina o diretório de trabalho dentro do container
105
WORKDIR /app
116

7+
# Copie os arquivos de requirements e instale as dependências
128
COPY requirements.txt .
139
RUN pip install --upgrade pip
14-
RUN pip install --no-cache-dir -r requirements.txt
10+
RUN pip install -r requirements.txt
1511

12+
# Copie todo o projeto para dentro do container
1613
COPY . .
1714

18-
# Coletar static files ANTES de rodar
19-
RUN python manage.py collectstatic --noinput
15+
# Exponha a porta que o Django vai rodar
16+
EXPOSE 8000
2017

21-
# Não exponha porta fixa - Railway usa $PORT
22-
CMD ["gunicorn", "argus_ia.wsgi:application", "--bind", "0.0.0.0:8000", "--workers", "3", "--timeout", "120"]
18+
# Comando para rodar o servidor Django
19+
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]

0 commit comments

Comments
 (0)