Skip to content

Commit

Permalink
add docker deploy support
Browse files Browse the repository at this point in the history
  • Loading branch information
lyc8503 committed Jan 26, 2024
1 parent 1709e1a commit c555f1e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Dockerfile
node_modules
.next
.vercel
.wrangler
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,5 @@ Temporary Items

# Built Visual Studio Code Extensions
*.vsix

.wrangler
20 changes: 20 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:20-bullseye-slim AS build

RUN npm install -g pnpm

COPY . /src
WORKDIR /src

RUN pnpm install
RUN npx @cloudflare/next-on-pages

FROM node:20-bullseye-slim AS runtime

COPY --from=build /src/.vercel /app/.vercel
WORKDIR /app
RUN npm install wrangler@3.24.0
RUN apt update && apt -y install ca-certificates && rm -rf /var/lib/apt/lists/*

EXPOSE 8788

CMD ["npx", "wrangler", "pages", "dev", ".vercel/output/static", "--ip=0.0.0.0", "--compatibility-flag=nodejs_compat", "--compatibility-date=2023-10-10", "--kv=ONEDRIVE_CF_INDEX_KV"]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

## What's different
- Now it can be deployed on Cloudflare Pages for free!
- Also support [Docker Deployment](https://github.com/lyc8503/onedrive-cf-index-ng/wiki/Docker-Deployment) now!
- No more dependency on Upstash / 3rd-party service
- Maybe some future maintenance or improvements from me ([@lyc8503](https://github.com/lyc8503))

Expand Down Expand Up @@ -138,7 +139,7 @@ Yes! Completely free with no backend server what-so-ever.

## Some TODOs
- Documentation
- Local/Docker deployment support
- [ x ] Local/Docker deployment support
- Some TODOs left in the code
- More tests

Expand Down

0 comments on commit c555f1e

Please sign in to comment.