🐞 fix: Update docker config

This commit is contained in:
2025-07-28 17:01:24 +00:00
parent 679059a360
commit f62eff64a0
3 changed files with 12 additions and 33 deletions

View File

@@ -1,19 +1,15 @@
# Dockerfile
FROM node:20-alpine FROM node:20-alpine
# Set working directory
WORKDIR /app WORKDIR /app
# Install dependencies
COPY app/package*.json ./ COPY app/package*.json ./
RUN npm install RUN npm install
# Copy source
COPY app . COPY app .
# Build the static site # Add this debug line:
RUN npm run build RUN echo "Build starting..." && npm run build && echo "Build finished." && ls -la dist
# Serve with a lightweight server (e.g., serve)
RUN npm install -g serve RUN npm install -g serve
CMD ["serve", "dist", "-l", "3000"]
CMD ["serve", "dist", "-l", "4321"]

View File

@@ -3,7 +3,7 @@
"type": "module", "type": "module",
"version": "0.0.1", "version": "0.0.1",
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev --host 0.0.0.0",
"build": "astro build", "build": "astro build",
"preview": "astro preview", "preview": "astro preview",
"astro": "astro" "astro": "astro"

View File

@@ -1,31 +1,14 @@
version: '3.8'
services: services:
frontend: frontend:
build: container_name: PromptBase
context: . image: promptbase
dockerfile: Dockerfile restart: unless-stopped
ports: ports:
- "3333:3000" - "4321:4321"
volumes: volumes:
- ./app:/app # - ./app:/app
- ./app/node_modules # - ./app/node_modules:/app/node_modules
- ./.env:/app/.env:ro # Bind-mount .env as read-only - ./.env:/app/.env:ro # Bind-mount .env as read-only
environment: environment:
- NODE_ENV=production - NODE_ENV=production
restart: unless-stopped
supabase:
image: supabase/postgres:15
ports:
- "54322:5432"
volumes:
- supabase-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${SUPABASE_DB_PASSWORD}
POSTGRES_USER: postgres
POSTGRES_DB: postgres
restart: unless-stopped
volumes:
supabase-data: