Ver Fonte

Update doc & Dockerfile

jerryliao há 2 dias atrás
pai
commit
58755619ad
3 ficheiros alterados com 10 adições e 8 exclusões
  1. 4 3
      Dockerfile
  2. 5 5
      README.md
  3. 1 0
      vite.config.ts

+ 4 - 3
Dockerfile

@@ -1,4 +1,4 @@
-FROM denoland/deno:1.38.3
+FROM denoland/deno:2.7.9
 
 ARG GIT_REVISION
 ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}
@@ -6,8 +6,9 @@ ENV DENO_DEPLOYMENT_ID=${GIT_REVISION}
 WORKDIR /app
 
 COPY . .
-RUN deno cache main.ts
+RUN deno install --allow-scripts
+RUN deno task build
 
 EXPOSE 8000
 
-CMD ["run", "-A", "main.ts"]
+CMD ["deno", "serve", "-A", "_fresh/server.js"]

+ 5 - 5
README.md

@@ -14,11 +14,11 @@ Visit [https://post.jerryliao.cn](https://post.jerryliao.cn)
 
 You can deploy the project with docker by using `Dockerfile` in this repo to
 build a docker image or use `Deno Deploy` officially recommended in
-[this doc](https://fresh.deno.dev/docs/getting-started/deploy-to-production)
+[this doc](https://fresh.deno.dev/docs/deployment/deno-deploy)
 
 ## Development
 
-Install `deno` runtime according to
-[this doc](https://docs.deno.com/runtime/manual), then execute `deno task start`
-in the project root, all the dependencies should be automatically installed.
-Then check `localhost:8000` in your browser for the website
+Install `deno` runtime according to [this doc](https://docs.deno.com/runtime/),
+then execute `deno task dev` in the project root, all the dependencies should be
+automatically installed. Then check `localhost:8000` in your browser for the
+website

+ 1 - 0
vite.config.ts

@@ -4,6 +4,7 @@ import { fresh } from "@fresh/plugin-vite";
 export default defineConfig({
   plugins: [fresh()],
   server: {
+    port: 8000,
     watch: {
       ignored: ["**/data/**"],
     },