-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 799 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (20 loc) · 799 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
# Criação de uma imagem Docker para o projeto SGE
FROM python:3.11-slim
# Variáveis de ambiente
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Pode ser alterado para o nome que desejar
# mas também pode ser /app OU /sge
WORKDIR /app
# copiou todos os arquivos do diretório atual para o diretório /sge
COPY . .
# Instalando as dependências do projeto
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Sempre executar o migrate antes de iniciar o servidor
# RUN python manage.py migrate
# Comando para expor a porta para acessar o projeto
EXPOSE 8000
# Comando para iniciar o servidor
CMD python manage.py migrate && python manage.py collectstatic --noinput && python manage.py runserver 0.0.0.0:8000
# CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]