fix Docker build

This commit is contained in:
Trit0 2026-02-06 21:07:02 -05:00
parent 6199181c98
commit c49ee70e15
3 changed files with 44 additions and 6 deletions

13
.dockerignore Normal file
View File

@ -0,0 +1,13 @@
node_modules/
npm-debug.log
.git
.gitignore
.DS_Store
.astro/
dist/
.idea/
.vscode/
.github/
.env.local
.env.*.local
*.log

View File

@ -22,8 +22,8 @@ concurrency:
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
# Build and deploy job
build-and-deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
@ -31,13 +31,26 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Build with Astro
run: npm run build
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'public'
path: 'dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@ -1,6 +1,18 @@
FROM nginx:alpine
# Build stage
FROM node:20-slim AS builder
COPY public/ /usr/share/nginx/html/
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
RUN npm run build
# Production stage
FROM nginx:latest
COPY --from=builder /app/dist /usr/share/nginx/html/
EXPOSE 80