diff --git a/Dockerfile b/Dockerfile index 08aa53def..18d80af18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ FROM node:20-alpine WORKDIR /app -# Install SQLite runtime +# Install SQLite runtime and serve RUN apk add --no-cache sqlite-libs COPY package*.json ./ @@ -40,5 +40,5 @@ ENV NODE_ENV=production ENV ASTRO_DB_REMOTE_URL=file:/app/data/consent.db ENV PORT=80 -# Start Astro preview server on port 80 -CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "80"] +# Use serve to host static files on port 80 +CMD ["npx", "serve", "dist", "-l", "80", "--config", "{\"directoryListing\": false, \"headers\": [{\"source\": \"**\", \"headers\": [{\"key\": \"Cache-Control\", \"value\": \"public, max-age=31536000, immutable\"}]}]}"] diff --git a/package.json b/package.json index f3cca2dad..6b904891c 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "astro": "^5.17.1", "astro-consent": "^1.0.17", "drizzle-orm": "^0.45.1", + "serve": "^14.2.4", "tailwindcss": "^4.2.1" } }