caiosampaio
caiosampaio
RRailway
Created by caiosampaio on 7/17/2023 in #✋|help
Docker sandbox
FROM python:3.9

RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
RUN curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update && apt-get install -y docker-ce-cli

# Instalação do Docker Compose
RUN curl -sSL https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose

# Configuração do diretório de trabalho e instalação de dependências
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Cópia dos arquivos do projeto
COPY . .

# Execução dos comandos de migração, coleta de arquivos estáticos e inicialização do servidor Gunicorn
CMD python manage.py migrate && python manage.py collectstatic --noinput && gunicorn core.wsgi
FROM python:3.9

RUN apt-get update && apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
RUN curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
RUN apt-get update && apt-get install -y docker-ce-cli

# Instalação do Docker Compose
RUN curl -sSL https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
RUN chmod +x /usr/local/bin/docker-compose

# Configuração do diretório de trabalho e instalação de dependências
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Cópia dos arquivos do projeto
COPY . .

# Execução dos comandos de migração, coleta de arquivos estáticos e inicialização do servidor Gunicorn
CMD python manage.py migrate && python manage.py collectstatic --noinput && gunicorn core.wsgi
8 replies
RRailway
Created by caiosampaio on 7/17/2023 in #✋|help
Docker sandbox
my Dockerfile.web:
8 replies
RRailway
Created by caiosampaio on 7/17/2023 in #✋|help
Docker sandbox
3ba430a8-05c7-4204-a9f8-68e3384f9370
8 replies
RRailway
Created by caiosampaio on 2/24/2023 in #✋|help
Execute services in Procfile
Thank you very much, that's how beat and web ran. But I managed to make the worker run with just this tweak: web: python manage.py migrate && python manage.py collectstatic --noinput & celery -A core worker --loglevel=INFO & celery -A core beat -l INFO & gunicorn core.wsgi
7 replies
RRailway
Created by caiosampaio on 2/24/2023 in #✋|help
Execute services in Procfile
3ba430a8-05c7-4204-a9f8-68e3384f9370
7 replies
RRailway
Created by caiosampaio on 2/3/2023 in #✋|help
Upload
N/A
4 replies
RRailway
Created by caiosampaio on 1/26/2023 in #✋|help
Celery django
N/A
6 replies
RRailway
Created by caiosampaio on 1/23/2023 in #✋|help
STATIC FILE AND CSRF_TOKEN
3ba430a8-05c7-4204-a9f8-68e3384f9370
4 replies