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: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
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: |
|
||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:${{ github.sha }}
|
||||
${{ secrets.REPO_HOST }}/${{ github.repository_owner }}/${{ github.event.repository.name }}:latest
|
||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -4,17 +4,28 @@ WORKDIR /app
|
|||
|
||||
COPY . .
|
||||
|
||||
# Build the Fresh application
|
||||
RUN deno task build
|
||||
|
||||
# Pre-cache the application dependencies
|
||||
RUN deno cache main.ts
|
||||
|
||||
FROM denoland/deno:alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy the Deno cache
|
||||
COPY --from=builder /deno-dir/ /deno-dir/
|
||||
|
||||
# Copy application code including both static directories
|
||||
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
|
||||
|
||||
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"]
|
||||
|
|
|
@ -8,6 +8,3 @@ services:
|
|||
- DENO_DEPLOYMENT=production
|
||||
ports:
|
||||
- "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 $posts from "./routes/posts.tsx";
|
||||
import * as $projects from "./routes/projects.tsx";
|
||||
|
||||
import * as $Example from "./islands/Example.tsx";
|
||||
import type { Manifest } from "$fresh/server.ts";
|
||||
|
||||
const manifest = {
|
||||
|
@ -24,7 +24,9 @@ const manifest = {
|
|||
"./routes/posts.tsx": $posts,
|
||||
"./routes/projects.tsx": $projects,
|
||||
},
|
||||
islands: {},
|
||||
islands: {
|
||||
"./islands/Example.tsx": $Example,
|
||||
},
|
||||
baseUrl: import.meta.url,
|
||||
} satisfies Manifest;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue