fix: Use serve for production hosting
- Added 'serve' package for static file hosting - Updated Dockerfile to use 'serve' instead of astro preview - serve has no host restrictions - Fixes Easypanel access issue
This commit is contained in:
@@ -19,7 +19,7 @@ FROM node:20-alpine
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install SQLite runtime
|
# Install SQLite runtime and serve
|
||||||
RUN apk add --no-cache sqlite-libs
|
RUN apk add --no-cache sqlite-libs
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
@@ -40,5 +40,5 @@ ENV NODE_ENV=production
|
|||||||
ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db
|
ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db
|
||||||
ENV PORT=80
|
ENV PORT=80
|
||||||
|
|
||||||
# Start Astro preview server on port 80
|
# Use serve to host static files on port 80
|
||||||
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "80"]
|
CMD ["npx", "serve", "dist", "-l", "80", "--config", "{\"directoryListing\": false, \"headers\": [{\"source\": \"**\", \"headers\": [{\"key\": \"Cache-Control\", \"value\": \"public, max-age=31536000, immutable\"}]}]}"]
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
"astro": "^5.17.1",
|
"astro": "^5.17.1",
|
||||||
"astro-consent": "^1.0.17",
|
"astro-consent": "^1.0.17",
|
||||||
"drizzle-orm": "^0.45.1",
|
"drizzle-orm": "^0.45.1",
|
||||||
|
"serve": "^14.2.4",
|
||||||
"tailwindcss": "^4.2.1"
|
"tailwindcss": "^4.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user