Limas
Limas
Explore posts from servers
RRailway
Created by Limas on 3/20/2024 in #✋|help
Multiple commands on start command won't work
I have a Django application for which I have a a Dockerfile, it works fine, but for a staging environment I wish to override the start command.
FROM python:3.10-slim-bullseye

ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /code

COPY . .

RUN pip install -r requirements.txt

CMD gunicorn core.wsgi --workers=2 --threads=4 --worker-class=gthread --log-file=- --worker-tmp-dir /dev/shm
FROM python:3.10-slim-bullseye

ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

WORKDIR /code

COPY . .

RUN pip install -r requirements.txt

CMD gunicorn core.wsgi --workers=2 --threads=4 --worker-class=gthread --log-file=- --worker-tmp-dir /dev/shm
I created the following json to chain multiple commands including the sleep 3 to wait for the private DNS, but it only executes the first command, I already did a ton of tests, if I remove the sleep in the deployment logs I get to see only the migrate command output but the server doesn't execute the gunicorn. If I remove everything and only leave the gunicorn it works normally.
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "sleep 3 && python manage.py migrate && gunicorn core.wsgi --workers=2 --threads=4 --worker-class=gthread --log-file=- --worker-tmp-dir /dev/shm",
"restartPolicyType": "NEVER",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS"
},
"deploy": {
"startCommand": "sleep 3 && python manage.py migrate && gunicorn core.wsgi --workers=2 --threads=4 --worker-class=gthread --log-file=- --worker-tmp-dir /dev/shm",
"restartPolicyType": "NEVER",
"restartPolicyMaxRetries": 10
}
}
7 replies
RRailway
Created by Limas on 9/15/2023 in #✋|help
Recover a file inside a deployment
By mistake I left a sqlite file inside a deployment and made a lot of updates to the database on that file. Is there any way to recover that file? or is lost forever? I haven't restart or touch the deployment to avoid lossing it 😦
10 replies
RRailway
Created by Limas on 8/26/2023 in #✋|help
Winston logs not appearing in deployment logs
In my node.js deployment if I do a console.log it appears normally in deployment logs, but using winston with info logging level messages never appear. Locally the log messages appear normally in the console. What could be causing this issue?
15 replies
RRailway
Created by Limas on 9/10/2022 in #✋|help
What defines the RAM usage?
12 replies