This commit is contained in:
parent
67f29ec389
commit
6194678607
4 changed files with 19 additions and 7 deletions
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
|
@ -30,6 +30,8 @@ jobs:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
push: true
|
push: true
|
||||||
|
cache-from: type=registry,ref=${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache
|
||||||
|
cache-to: type=registry,ref=${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:buildcache,mode=max
|
||||||
tags: |
|
tags: |
|
||||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -4,17 +4,28 @@ WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Build the Fresh application
|
||||||
|
RUN deno task build
|
||||||
|
|
||||||
|
# Pre-cache the application dependencies
|
||||||
RUN deno cache main.ts
|
RUN deno cache main.ts
|
||||||
|
|
||||||
FROM denoland/deno:alpine
|
FROM denoland/deno:alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the Deno cache
|
||||||
COPY --from=builder /deno-dir/ /deno-dir/
|
COPY --from=builder /deno-dir/ /deno-dir/
|
||||||
|
|
||||||
|
# Copy application code including both static directories
|
||||||
COPY --from=builder /app/ /app/
|
COPY --from=builder /app/ /app/
|
||||||
|
|
||||||
|
# Ensure static assets directories permissions are set correctly
|
||||||
|
RUN chmod -R 755 /app/static /app/_fresh/static
|
||||||
|
|
||||||
ENV DENO_DEPLOYMENT=production
|
ENV DENO_DEPLOYMENT=production
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
CMD ["run", "-A", "main.ts"]
|
# Run with appropriate flags for static file serving
|
||||||
|
CMD ["run", "--allow-net", "--allow-read", "--allow-env", "main.ts"]
|
||||||
|
|
|
@ -7,7 +7,4 @@ services:
|
||||||
environment:
|
environment:
|
||||||
- DENO_DEPLOYMENT=production
|
- DENO_DEPLOYMENT=production
|
||||||
ports:
|
ports:
|
||||||
- "3000:8000"
|
- "3000:8000"
|
||||||
# If you need to persist any data
|
|
||||||
volumes:
|
|
||||||
- ./data:/app/data
|
|
|
@ -10,7 +10,7 @@ import * as $index from "./routes/index.tsx";
|
||||||
import * as $post_slug_ from "./routes/post/[slug].tsx";
|
import * as $post_slug_ from "./routes/post/[slug].tsx";
|
||||||
import * as $posts from "./routes/posts.tsx";
|
import * as $posts from "./routes/posts.tsx";
|
||||||
import * as $projects from "./routes/projects.tsx";
|
import * as $projects from "./routes/projects.tsx";
|
||||||
|
import * as $Example from "./islands/Example.tsx";
|
||||||
import type { Manifest } from "$fresh/server.ts";
|
import type { Manifest } from "$fresh/server.ts";
|
||||||
|
|
||||||
const manifest = {
|
const manifest = {
|
||||||
|
@ -24,7 +24,9 @@ const manifest = {
|
||||||
"./routes/posts.tsx": $posts,
|
"./routes/posts.tsx": $posts,
|
||||||
"./routes/projects.tsx": $projects,
|
"./routes/projects.tsx": $projects,
|
||||||
},
|
},
|
||||||
islands: {},
|
islands: {
|
||||||
|
"./islands/Example.tsx": $Example,
|
||||||
|
},
|
||||||
baseUrl: import.meta.url,
|
baseUrl: import.meta.url,
|
||||||
} satisfies Manifest;
|
} satisfies Manifest;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue