diff --git a/Dockerfile b/Dockerfile index 0fedfe229..e693f7af8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,11 +7,9 @@ COPY package*.json ./ RUN npm install COPY . . - -# Create data directory for database RUN mkdir -p data -# Build the project +# Build project RUN npm run build # Production Stage @@ -22,11 +20,10 @@ WORKDIR /app # Install SQLite runtime RUN apk add --no-cache sqlite-libs -# Copy only production dependencies COPY package*.json ./ RUN npm install --production -# Copy built assets from builder +# Copy built assets COPY --from=builder /app/dist ./dist COPY --from=builder /app/data ./data @@ -40,5 +37,5 @@ ENV NODE_ENV=production ENV ASTRO_PORT=80 ENV ASTRO_HOST=0.0.0.0 -# Run preview command but allow all hosts via ENV instead of config -CMD ["sh", "-c", "npx astro preview --host 0.0.0.0 --port 80"] +# Serve static files using serve package with all-host access +CMD ["npx", "serve", "--listen", "80", "--single", "dist"]