bebop
bebop
RRailway
Created by bebop on 10/8/2024 in #✋|help
Invalid cache mounts
I receive Invalid cache mounts on this Dockerfile but I am not sure why, I am following the Railway docs exactly. Any help would be greatly appreciated, thanks.
# syntax=docker/dockerfile:1

# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Dockerfile reference guide at
# https://docs.docker.com/go/dockerfile-reference/

# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7

ARG PYTHON_VERSION=3.11.4
FROM python:${PYTHON_VERSION}-slim as base

# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1

# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1

# Install custom dependencies for pypandoc and weasyprint.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pandoc \
texlive \
lmodern \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libharfbuzz-subset0 \
libjpeg-dev \
libopenjp2-7-dev \
libffi-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Create a non-privileged user that the app will run under.
# See https://docs.docker.com/go/dockerfile-user-best-practices/
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser

# Download dependencies as a separate step to take advantage of Docker's caching.
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
# Leverage a bind mount to requirements.txt to avoid having to copy them into
# into this layer.
RUN --mount=type=cache,id=s/d5f99fa7-4033-4d6f-a46c-46ae0524ae87-/root/.cache/pip,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt

# Switch to the non-privileged user to run the application.
USER appuser

# Copy the source code into the container.
COPY . .

# Expose the port that the application listens on.
EXPOSE 8000

# Run the application.
CMD hypercorn main:app --bind [::]:8000
# syntax=docker/dockerfile:1

# Comments are provided throughout this file to help you get started.
# If you need more help, visit the Dockerfile reference guide at
# https://docs.docker.com/go/dockerfile-reference/

# Want to help us make this template better? Share your feedback here: https://forms.gle/ybq9Krt8jtBL3iCk7

ARG PYTHON_VERSION=3.11.4
FROM python:${PYTHON_VERSION}-slim as base

# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1

# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1

# Install custom dependencies for pypandoc and weasyprint.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
pandoc \
texlive \
lmodern \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libharfbuzz-subset0 \
libjpeg-dev \
libopenjp2-7-dev \
libffi-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Create a non-privileged user that the app will run under.
# See https://docs.docker.com/go/dockerfile-user-best-practices/
ARG UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
appuser

# Download dependencies as a separate step to take advantage of Docker's caching.
# Leverage a cache mount to /root/.cache/pip to speed up subsequent builds.
# Leverage a bind mount to requirements.txt to avoid having to copy them into
# into this layer.
RUN --mount=type=cache,id=s/d5f99fa7-4033-4d6f-a46c-46ae0524ae87-/root/.cache/pip,target=/root/.cache/pip \
--mount=type=bind,source=requirements.txt,target=requirements.txt \
python -m pip install -r requirements.txt

# Switch to the non-privileged user to run the application.
USER appuser

# Copy the source code into the container.
COPY . .

# Expose the port that the application listens on.
EXPOSE 8000

# Run the application.
CMD hypercorn main:app --bind [::]:8000
8 replies
RRailway
Created by bebop on 9/1/2024 in #✋|help
Edited public network domain not working
When I use the Railway generated public network domain my Python FastAPI server works and responds as expected. However, when I edit and change the domain of the generated -.up.railway.app to an edited and custom -.up.railway.app the URL and response times out.
12 replies
RRailway
Created by bebop on 7/23/2024 in #✋|help
Prisma: Can't reach database server
Hi, I am using Prisma + Next.js deployed on Vercel, and communicating over public network with my Railway SQL database. This has been working fine for me, however I started traveling overseas and now I am having a hard time developing or communicating with the database at all because I constantly receive Can't reach database server at 'roundhouse.proxy.rlwy.net': 40050. I have already looked through this Discord for solutions and implemented what was suggested here: https://stackoverflow.com/questions/68476229/m1-related-prisma-cant-reach-database-server-at-database5432, which helped a little bit but still inconsistent with my ability to connect + query. I believe this issue is very common for me now as I am in Asia and communicating with my db that is located in US East. How can I resolve or fix this? Is there something else I can do with Prisma to remedy this issue? My belief and reason for this post is that the issue is coming from Railway's ability to handle and serve requests that are across the globe and not near the region where most of my usage normally happens. Any help @Brody would be greatly appreciated, thank you!
101 replies
RRailway
Created by bebop on 5/8/2024 in #✋|help
[ERROR] [MY-013131] [Server] Out of sort memory, consider increasing server sort buffer size!
No description
52 replies