caiosampaio
caiosampaio
RRailway
Created by caiosampaio on 7/17/2023 in #✋|help
Docker sandbox
Hello, I have a Python/Django application that runs third-party Python code. For security reasons I run them in a sandbox environment
comando = f'sudo docker compose -f {self.FULL_PATH_DOCKER_COMPOSE} run sandbox python {self.NAME_FILE}'

processo = subprocess.Popen(
comando,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
comando = f'sudo docker compose -f {self.FULL_PATH_DOCKER_COMPOSE} run sandbox python {self.NAME_FILE}'

processo = subprocess.Popen(
comando,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
text=True,
)
But when running the command I get the message docker: command not found, I've tried with docker-compose and it gives the same error. The above code is running inside the web container. my Railway.yml:
services:
web:
build:
context: .
dockerfile: Dockerfile.web
worker:
build: .
command: celery -A core worker --loglevel=INFO
beat:
build: .
command: celery -A core beat -l INFO
services:
web:
build:
context: .
dockerfile: Dockerfile.web
worker:
build: .
command: celery -A core worker --loglevel=INFO
beat:
build: .
command: celery -A core beat -l INFO
Any suggestions please?
8 replies
RRailway
Created by caiosampaio on 2/24/2023 in #✋|help
Execute services in Procfile
I have the following Procfile: web: python manage.py migrate && python manage.py collectstatic --noinput && gunicorn core.wsgi worker: celery -A core worker --loglevel=INFO beat: celery -A core beat -l INFO But when I push to GitHub, only web is launched. How do I get the woker and beat to run as well. Preferably automatically as well as the web, I have already tried using the command: railway run worker, but I got the following error: exec: "worker": executable file not found in $PATH I've also tried starting all tasks in a single service: 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 But in this case, only the worker started the beat and not the web.
7 replies
RRailway
Created by caiosampaio on 2/3/2023 in #✋|help
Upload
How to change the maximum upload size and maximum time supported in the railways interface
4 replies
RRailway
Created by caiosampaio on 1/26/2023 in #✋|help
Celery django
I'm trying to deploy a celery worker but I'm getting the following error: [2023-01-26 02:02:34,683: CRITICAL/MainProcess] Unrecoverable error: WorkerLostError('Could not start worker processes') Traceback (most recent call last): My Procfile: web: python manage.py migrate && python manage.py collectstatic --noinput && celery -A core worker --loglevel=INFO && gunicorn core.wsgi
6 replies
RRailway
Created by caiosampaio on 1/23/2023 in #✋|help
STATIC FILE AND CSRF_TOKEN
csrf_token error in post requests after deployment on railway (All settings for csrf_token have been done). How can I serve the static files without whitenoise
4 replies