Antoin Campbell
06/27/2021, 4:23 PMprisma migrate deploy
during the build step and im getting this error:
[builder 7/9] RUN npx prisma migrate deploy:
#11 1.611 Prisma schema loaded from prisma/schema.prisma
#11 1.644 Error: Get config: Schema Parsing P1012
#11 1.644
#11 1.644 error: Environment variable not found: DATABASE_URL.
#11 1.644 --> schema.prisma:6
#11 1.644 |
#11 1.644 5 | provider = "postgresql"
#11 1.644 6 | url = env("DATABASE_URL")
#11 1.644 |
#11 1.644
#11 1.644 Validation Error Count: 1
#11 1.644
I have the DATABASE_URL
environment variable set inside of the cloud run service environment but I have a feeling this is probably not helpful during the build step as I believe that is a runtime concern.
anyone have any thoughts or suggestions on this flow/problem?Ryan
06/28/2021, 6:14 AMmigrate deploy
needs the environment variable. Could you make sure that it’s accessible inside the container by echoing the variable? If it’s available, then this is a bug that you can create an issue for here.Antoin Campbell
06/28/2021, 1:28 PM.env
file is not accessible/being read in my docker container?Ryan
06/28/2021, 1:31 PMVariables and Secrets
tab not reflect in the container?Antoin Campbell
06/28/2021, 1:33 PMVariables and Secrets
tab is? could you expand on that? I just have a .env
file in the root of the application.Ryan
06/28/2021, 1:37 PMI just have aThis should work. Does the container have thefile in the root of the application..env
.env
file present?Antoin Campbell
06/28/2021, 1:39 PMDockerfile
because the .env
is not present. Here is my Dockerfile
:
FROM node:14 AS base
WORKDIR /usr/src/app
FROM base AS build
COPY package*.json ./
COPY prisma ./prisma/
RUN yarn install --production
RUN npx prisma generate
# RUN npx prisma migrate deploy
COPY ./ ./
RUN yarn build
FROM base AS runtime
COPY --from=build /usr/src/app/node_modules ./node_modules
COPY --from=build /usr/src/app/package.json ./
COPY --from=build /usr/src/app/yarn.lock ./
COPY --from=build /usr/src/app/dist ./dist
# Run the web service on container startup.
CMD [ "yarn", "start:prod"]
Ryan
06/28/2021, 1:45 PMDockerfile
seems fine.Antoin Campbell
06/28/2021, 1:53 PM