R
Railway4mo ago
Zazh

Private network DB not found

Hi! It's saying that the private network can't be found.
25 Replies
Percy
Percy4mo ago
Project ID: N/A
Zazh
Zazh4mo ago
No description
Brody
Brody4mo ago
are you building with an alpine image?
Zazh
Zazh4mo ago
yeah
Zazh
Zazh4mo ago
ok i'll check it out
Zazh
Zazh4mo ago
No description
Zazh
Zazh4mo ago
this is my env DB_CONNECTION_URL=${{DB-SQL.MYSQL_PRIVATE_URL}}/support
Brody
Brody4mo ago
screenshot of your project please
Zazh
Zazh4mo ago
No description
Brody
Brody4mo ago
have you modified any variables on the DB-SQL service
Zazh
Zazh4mo ago
yeah, i removed the last section on the private db url part since i have multiple databases on that service
Brody
Brody4mo ago
yeah I figured, just needed to make sure
Zazh
Zazh4mo ago
ok i think i fixed it i had a trailing slash in the DB's env
Brody
Brody4mo ago
ha that was going to be my next question
Zazh
Zazh4mo ago
is there a way to have a build path different then the running path
Brody
Brody4mo ago
you're building with a dockerfile that's entirely up to you
Zazh
Zazh4mo ago
can i show you my dockerfile because i'm a bit confused on that
Brody
Brody4mo ago
of course, though I'd likely still need more context than that
Zazh
Zazh4mo ago
# syntax=docker/dockerfile:1

FROM node:18-alpine AS builder
WORKDIR /build

RUN apk add --no-cache make gcc g++ python3

RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml ./
COPY --link scripts scripts
RUN chmod +x ./scripts/start.sh
# install dependencies, CI=true to skip pre/postinstall scripts
RUN CI=true pnpm install --prod --frozen-lockfile
COPY --link . .

FROM node:18-alpine AS runner
RUN apk --no-cache add curl \
&& adduser --disabled-password --home /home/container container \
&& mkdir /app \
&& chown container:container /app \
&& chmod -R 777 /app
USER container
ENV USER=container \
HOME=/home/container \
NODE_ENV=production \
HTTP_HOST=0.0.0.0 \
DOCKER=true
WORKDIR /home/container
COPY --from=builder --chown=container:container --chmod=777 /build /app
ENTRYPOINT [ "/app/scripts/start.sh" ]
# syntax=docker/dockerfile:1

FROM node:18-alpine AS builder
WORKDIR /build

RUN apk add --no-cache make gcc g++ python3

RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml ./
COPY --link scripts scripts
RUN chmod +x ./scripts/start.sh
# install dependencies, CI=true to skip pre/postinstall scripts
RUN CI=true pnpm install --prod --frozen-lockfile
COPY --link . .

FROM node:18-alpine AS runner
RUN apk --no-cache add curl \
&& adduser --disabled-password --home /home/container container \
&& mkdir /app \
&& chown container:container /app \
&& chmod -R 777 /app
USER container
ENV USER=container \
HOME=/home/container \
NODE_ENV=production \
HTTP_HOST=0.0.0.0 \
DOCKER=true
WORKDIR /home/container
COPY --from=builder --chown=container:container --chmod=777 /build /app
ENTRYPOINT [ "/app/scripts/start.sh" ]
Brody
Brody4mo ago
alright, nothing too crazy going on, what's not working?
Zazh
Zazh4mo ago
alright so it builds and then tries to access /app when it's deployed but then says /app doesn't exist
Brody
Brody4mo ago
try setting the workdir to app, you have it set to /home/container but also show me the exact error message please
Zazh
Zazh4mo ago
No description
Zazh
Zazh4mo ago
trying your thing ok gotta go for abt 30 mins i'll be back