ebitybatata
ebitybatata
RRailway
Created by ebitybatata on 5/24/2024 in #✋|help
Unable to search logs. Has something changed with how log search works recently?
I am searching for logs that I know exist, but the search always comes up to nothing.
18 replies
RRailway
Created by ebitybatata on 2/14/2024 in #✋|help
Environment variables not picked up when using docker to build project
Project id: 6b106510-a373-44f1-9ffe-d7b7199cf99a I'm changing the way my node js to built to use docker, when running the build command in the docker file I'm getting errors around environment variables not being set. They exist however in the railway variables. My docker file
# Use a Node.js base image
FROM node:21-alpine

# Install ffmpeg
RUN apk update && apk add --no-cache ffmpeg curl openrc

# Install Tailscale
RUN curl -fsSL https://tailscale.com/install.sh | sh

# Set the working directory inside the container
WORKDIR /app

# Copy the project files to the container's working directory
COPY . .

# Install Node.js dependencies
RUN yarn install

# Your custom build command
RUN npx prisma db push --schema=src/lib/prisma/schema.prisma && npx prisma generate --schema=src/lib/prisma/schema.prisma && yarn build

# Make the start script executable
RUN chmod +x start.sh

# Start Tailscale and your application via the start script
CMD ["./start.sh"]
# Use a Node.js base image
FROM node:21-alpine

# Install ffmpeg
RUN apk update && apk add --no-cache ffmpeg curl openrc

# Install Tailscale
RUN curl -fsSL https://tailscale.com/install.sh | sh

# Set the working directory inside the container
WORKDIR /app

# Copy the project files to the container's working directory
COPY . .

# Install Node.js dependencies
RUN yarn install

# Your custom build command
RUN npx prisma db push --schema=src/lib/prisma/schema.prisma && npx prisma generate --schema=src/lib/prisma/schema.prisma && yarn build

# Make the start script executable
RUN chmod +x start.sh

# Start Tailscale and your application via the start script
CMD ["./start.sh"]
The error I'm seeing on the failed build.
#11 [7/8] RUN npx prisma db push --schema=src/lib/prisma/schema.prisma && npx prisma generate --schema=src/lib/prisma/schema.prisma && yarn build



#11 1.922 Prisma schema loaded from src/lib/prisma/schema.prisma



#11 1.929 Datasource "db": PostgreSQL database

#11 1.932



#11 1.932 Error: Prisma schema validation - (get-config wasm)

#11 1.932 Error code: P1012

#11 1.932 error: Environment variable not found: DATABASE_URL.

#11 1.932 --> schema.prisma:7

#11 1.932 |

#11 1.932 6 | provider = "postgresql"

#11 1.932 7 | url = env("DATABASE_URL")

#11 1.932 |

#11 1.932
#11 [7/8] RUN npx prisma db push --schema=src/lib/prisma/schema.prisma && npx prisma generate --schema=src/lib/prisma/schema.prisma && yarn build



#11 1.922 Prisma schema loaded from src/lib/prisma/schema.prisma



#11 1.929 Datasource "db": PostgreSQL database

#11 1.932



#11 1.932 Error: Prisma schema validation - (get-config wasm)

#11 1.932 Error code: P1012

#11 1.932 error: Environment variable not found: DATABASE_URL.

#11 1.932 --> schema.prisma:7

#11 1.932 |

#11 1.932 6 | provider = "postgresql"

#11 1.932 7 | url = env("DATABASE_URL")

#11 1.932 |

#11 1.932
16 replies