make prisma work in docker image
This commit is contained in:
parent
aa8b9855d3
commit
5b9a8034b3
1 changed files with 7 additions and 2 deletions
|
|
@ -24,12 +24,16 @@ RUN unzip -j bun-linux-*.zip -d /usr/local/bin && \
|
||||||
# this will cache them and speed up future builds
|
# this will cache them and speed up future builds
|
||||||
FROM base AS install
|
FROM base AS install
|
||||||
RUN mkdir -p /temp/dev
|
RUN mkdir -p /temp/dev
|
||||||
COPY package.json bun.lock prisma/ /temp/dev/
|
COPY package.json bun.lock /temp/dev/
|
||||||
|
COPY prisma /temp/dev/prisma/
|
||||||
|
RUN sed -i 's|file:../data/mydb.sqlite|file:/app/data/mydb.sqlite|g' /temp/dev/prisma/schema.prisma
|
||||||
RUN cd /temp/dev && bun install --frozen-lockfile && bun prisma generate
|
RUN cd /temp/dev && bun install --frozen-lockfile && bun prisma generate
|
||||||
|
|
||||||
# install with --production (exclude devDependencies)
|
# install with --production (exclude devDependencies)
|
||||||
RUN mkdir -p /temp/prod
|
RUN mkdir -p /temp/prod
|
||||||
COPY package.json bun.lock prisma/ /temp/prod/
|
COPY package.json bun.lock /temp/prod/
|
||||||
|
COPY prisma /temp/prod/prisma/
|
||||||
|
RUN sed -i 's|file:../data/mydb.sqlite|file:/app/data/mydb.sqlite|g' /temp/prod/prisma/schema.prisma
|
||||||
RUN cd /temp/prod && bun install --frozen-lockfile --production && bun prisma generate
|
RUN cd /temp/prod && bun install --frozen-lockfile --production && bun prisma generate
|
||||||
|
|
||||||
FROM base AS prerelease
|
FROM base AS prerelease
|
||||||
|
|
@ -93,6 +97,7 @@ RUN ARCH=$(uname -m) && \
|
||||||
COPY --from=install /temp/prod/node_modules node_modules
|
COPY --from=install /temp/prod/node_modules node_modules
|
||||||
COPY --from=prerelease /app/public/ /app/public/
|
COPY --from=prerelease /app/public/ /app/public/
|
||||||
COPY --from=prerelease /app/dist /app/dist
|
COPY --from=prerelease /app/dist /app/dist
|
||||||
|
COPY --from=prerelease /app/prisma /app/prisma
|
||||||
|
|
||||||
# COPY . .
|
# COPY . .
|
||||||
RUN mkdir data
|
RUN mkdir data
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue