2
This commit is contained in:
+1
-1
@@ -14,6 +14,6 @@ frontend/.env.local
|
||||
frontend/.env.*.local
|
||||
node_modules
|
||||
npm-debug.log*
|
||||
Dockerfile*
|
||||
Dockerfile
|
||||
docker-compose*.yml
|
||||
docker-compose*.yaml
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
FROM node:22-bookworm-slim AS frontend-builder
|
||||
|
||||
WORKDIR /app/frontend
|
||||
COPY frontend/package.json frontend/package-lock.json* ./
|
||||
RUN npm ci
|
||||
COPY frontend ./
|
||||
ARG NEXT_PUBLIC_API_URL=
|
||||
ARG BACKEND_INTERNAL_URL=http://127.0.0.1:8000
|
||||
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||
ENV BACKEND_INTERNAL_URL=$BACKEND_INTERNAL_URL
|
||||
RUN npm run build
|
||||
|
||||
FROM python:3.12-slim
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV NODE_ENV=production
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates curl ffmpeg \
|
||||
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
|
||||
&& apt-get install -y --no-install-recommends nodejs \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY backend ./backend
|
||||
COPY scripts ./scripts
|
||||
COPY --from=frontend-builder /app/frontend/.next ./frontend/.next
|
||||
COPY --from=frontend-builder /app/frontend/package.json ./frontend/package.json
|
||||
COPY --from=frontend-builder /app/frontend/node_modules ./frontend/node_modules
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["bash", "scripts/start-coolify.sh"]
|
||||
+12
-29
@@ -1,21 +1,27 @@
|
||||
services:
|
||||
frontend:
|
||||
app:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: Dockerfile.coolify
|
||||
args:
|
||||
NEXT_PUBLIC_API_URL: ""
|
||||
BACKEND_INTERNAL_URL: http://backend:8000
|
||||
BACKEND_INTERNAL_URL: http://127.0.0.1:8000
|
||||
environment:
|
||||
APP_ENV: production
|
||||
APP_DATA_DIR: /app/data
|
||||
DATABASE_PATH: /app/data/app.db
|
||||
MISTRAL_API_KEY: ${MISTRAL_API_KEY:-}
|
||||
MISTRAL_OCR_MODEL: ${MISTRAL_OCR_MODEL:-mistral-ocr-latest}
|
||||
DEEPGRAM_API_KEY: ${DEEPGRAM_API_KEY:-}
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
HOSTNAME: 0.0.0.0
|
||||
volumes:
|
||||
- station-data:/app/data
|
||||
expose:
|
||||
- "3000"
|
||||
ports:
|
||||
- "3000"
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"]
|
||||
@@ -24,28 +30,5 @@ services:
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
APP_ENV: production
|
||||
APP_DATA_DIR: /app/data
|
||||
DATABASE_PATH: /app/data/app.db
|
||||
MISTRAL_API_KEY: ${MISTRAL_API_KEY:-}
|
||||
MISTRAL_OCR_MODEL: ${MISTRAL_OCR_MODEL:-mistral-ocr-latest}
|
||||
DEEPGRAM_API_KEY: ${DEEPGRAM_API_KEY:-}
|
||||
volumes:
|
||||
- station-data:/app/data
|
||||
expose:
|
||||
- "8000"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=5)"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 20s
|
||||
|
||||
volumes:
|
||||
station-data:
|
||||
|
||||
Reference in New Issue
Block a user