Skip to content

Commit

Permalink
chore: fix all docker problem?
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovler-Young committed Jun 23, 2024
1 parent 7ed46b1 commit 701177b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
20 changes: 20 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
app/pnpm-lock.yaml
.vscode

.DS_Store
node_modules
/build
dist
/.svelte-kit

.env
/package
.env.*
!.env.example

vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vercel
.cloudflare

.env.local
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,27 @@ LABEL org.opencontainers.image.source=https://github.com/saveweb/biliarchiverbot
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app

COPY pnpm-lock.yaml ./
COPY package.json ./

FROM base AS deps
RUN pnpm fetch

FROM deps AS prod-deps
RUN pnpm install --prod --offline

FROM deps AS build
COPY . .
RUN pnpm install --offline

ENV BILIARCHIVER_WEBAPP=https://example.com/
ENV BILIARCHIVER_USERNAME=example
ENV BILIARCHIVER_API=https://example.com/
ENV BILIARCHIVER_BOT=example

RUN pnpm run build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/node_modules /app/node_modules
COPY --from=build /app/.svelte-kit/output /app/.svelte-kit/output
EXPOSE 5173
CMD ["pnpm", "vite", "dev", "--host", "--port", "5173"]
CMD ["pnpm", "dev", "--host", "--port", "5173"]

0 comments on commit 701177b

Please sign in to comment.