ZeroxAdvanced
ZeroxAdvanced
RRailway
Created by ZeroxAdvanced on 5/8/2024 in #✋|help
Private network setup help
Hi all hope someone can help us. Sofar loving Railway! We have a Django application that we want to use as API layer with private networking but also want the admin panel to be accessible. Right now we use uvicorn because we need it for async actions. Our dockerfile looks like this.
# For public networking in production:
CMD uvicorn wisepimnew.asgi:application --host 0.0.0.0 --port $PORT & \
# For private networking in production:
# CMD uvicorn wisepimnew.asgi:application --host :: --port $PORT & \
# For public networking in production:
CMD uvicorn wisepimnew.asgi:application --host 0.0.0.0 --port $PORT & \
# For private networking in production:
# CMD uvicorn wisepimnew.asgi:application --host :: --port $PORT & \
But we would like to have both ‘::’ as host for private networking and ‘0.0.0.0’ so the Django admin can be accessed. Is there any solution for this? Project id: 04e1fc6d-4c23-41fc-b62d-9f4ae0620318
4 replies
RRailway
Created by ZeroxAdvanced on 12/21/2023 in #✋|help
Help with Dockerfile, mouting volumes and executing python scripts from subfolders
No description
10 replies
RRailway
Created by ZeroxAdvanced on 12/19/2023 in #✋|help
Not correct python version in Nixpack when using dockerfile (used to work)
Hi there I am using a dockerFile with python:3.10-slim-buster
# Pull the official base image
FROM python:3.10-slim-buster

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# The port environment variable is set by Railway when the container is run
# But we can default it to 8080 for local development
ENV PORT=8080

# Expose the port
EXPOSE $PORT

# Set work directory in the container
WORKDIR /code

# Install dependencies
# Copying the requirements file and installing dependencies separately
# from copying the entire project ensures that Docker's cache is used more effectively,
# and dependencies are not unnecessarily reinstalled upon every build.
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt

# Copy project
COPY . /code/

# Command to run on container start ter
#CMD ["python", "main.py"]

# Command to run on container start
CMD uvicorn main:app --host 0.0.0.0 --port $PORT'
# Pull the official base image
FROM python:3.10-slim-buster

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# The port environment variable is set by Railway when the container is run
# But we can default it to 8080 for local development
ENV PORT=8080

# Expose the port
EXPOSE $PORT

# Set work directory in the container
WORKDIR /code

# Install dependencies
# Copying the requirements file and installing dependencies separately
# from copying the entire project ensures that Docker's cache is used more effectively,
# and dependencies are not unnecessarily reinstalled upon every build.
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt

# Copy project
COPY . /code/

# Command to run on container start ter
#CMD ["python", "main.py"]

# Command to run on container start
CMD uvicorn main:app --host 0.0.0.0 --port $PORT'
Problem: when i am deploying from my git it and I see the docker image being compiled i see using python setup │ python38, gcc
I think i am not getting python version 3.10 as my dependancies seem broken but the python version is 3.8? This wasn't the case as i now cant install numpy. On my local machine the requirements.txt work perfectly and i can install all dependancies fine on WSL.
13.35 ERROR: Could not find a version that satisfies the requirement pandas==2.1.4 (from versions: 0.1,
13.35 ERROR: Could not find a version that satisfies the requirement pandas==2.1.4 (from versions: 0.1,
I used to compile the same image perfectly with the same docker file on railway in other project (haven't rebuild it since weeks though). What could be wrong? Any help would be appricated. project id =16173128-f966-4c24-9def-b463fcd1f62d
7 replies
RRailway
Created by ZeroxAdvanced on 11/7/2023 in #✋|help
NiceGUI deployment to Railway help with dockerfile
Hi I hope someone can help me. So far I am loving Railway. I already have a Django project and it runs fine. Now I am using nicegui to build an app but I cannot get the deployment to Railway working. App Code is mostly in main.py How to deploy my nicegui app to railway? I created a dockerfile and it seems succesfully running but I think uvicorn is not running? Code is below: # Pull the official base image FROM python:3.10-slim-buster # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # The port environment variable is set by Railway when the container is run # But we can default it to 8080 for local development ENV PORT=8080 # Expose the port EXPOSE $PORT # Set work directory in the container WORKDIR /code # Install dependencies COPY requirements.txt /code/ RUN pip install --upgrade pip RUN pip install -r requirements.txt # Copy project COPY . /code/ # Command to run on container start CMD ["python", "main.py"] In the console I get the feed: NiceGUI ready to go on http://localhost:8080, and http://172.17.2.235:8080 But i think i need to expose it with the uvicorn? Can someone help? project id: 3e62bf9f-3eee-4bbd-80e8-83d7d0e2acf1
49 replies
RRailway
Created by ZeroxAdvanced on 5/22/2023 in #✋|help
Trying to get Shopware Running please help
Hi there I am trying to get Shopware Running on Railway. I have created a Dockerfile on my repo but I am not sure how to continue Here is my Dockerfile. Please note that on the official documentation I need to have a mysql root password. https://github.com/shyim/shopware But I cant find this in the Railway mysql settings. When I add the service. FROM mysql:8.0 ENV MYSQL_ROOT_PASSWORD= ENV MYSQL_DATABASE= ENV MYSQL_USER= ENV MYSQL_PASSWORD= FROM shyim/shopware:6.4.20-php8.2 ENV APP_SECRET=440dec3766de53010c5ccf6231c182acfc90bd25cff82e771245f736fd276518 ENV INSTANCE_ID=10612e3916e153dd3447850e944a03fabe89440970295447a30a75b151bd844e ENV APP_URL=shopware-production.up.railway.app ENV BLUE_GREEN_DEPLOYMENT=0 ENV DATABASE_HOST=containers-us-west-196.railway.app ENV DATABASE_URL= [in railway account] EXPOSE 80 What am I doing wrong? Can someone help me to get the Shopware running on Railway. Perhaps someone can create a template also for Shopware? Project id is = f10cea7d-637b-4586-9521-f7437e389296
4 replies
RRailway
Created by ZeroxAdvanced on 5/12/2023 in #✋|help
Cant run Django in Uvicorn with Dockerfile
Django with uvi corn Hi all i am trying to get Django working with uvcorn. Guni corn works perfect but now I would like to use uvicorn since i have some async processes. My docker file is here. # Pull the official base image test FROM python:3.10-slim-buster # Set environment variables ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 # Set work directory in the container WORKDIR /code # Install dependencies COPY requirements.txt /code/ RUN pip install --upgrade pip RUN pip install -r requirements.txt # Copy project COPY . /code/ RUN python manage.py collectstatic --noinput # Expose the port uWSGI will listen on EXPOSE 8000 # Command to run the uWSGI server CMD ["uvicorn", "myapp.asgi:application", "--host", "0.0.0.0", "--port", "8000", "--lifespan", "off"] The build seems to finish and also the server is running. However I get Application failed to respond on railway. What am i doing wrong? Also note that I am using RabbitMQ (Externally hosted) and views that connect to RabbitMQ. Do i need to start a worker? Local host works perfect with just the python -m uvicorn myproject.asgi:application command. Any help is really appricated! project id: 04e1fc6d-4c23-41fc-b62d-9f4ae0620318
6 replies