Dockerfile
1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM node:20-alpine AS frontend-builder
WORKDIR /app/apps/web_ui
COPY apps/web_ui/package*.json ./
RUN npm ci
COPY apps/web_ui/ ./
RUN npm run build
FROM ghcr.io/666ghj/bettafish:latest
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN apt-get update \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt ./requirements.txt
COPY vendor/mediacrawler/requirements.txt ./media_crawler.requirements.txt
RUN python -m pip install --no-cache-dir -r requirements.txt
RUN python -m pip install --no-cache-dir -r media_crawler.requirements.txt
COPY .env.example .env
COPY . .
COPY --from=frontend-builder /app/static/frontend /app/static/frontend
RUN mkdir -p \
/app/var/logs \
/app/var/reports/final \
/app/var/reports/engines/insight \
/app/var/reports/engines/media \
/app/var/reports/engines/query \
/app/var/output \
/app/var/crawler/browser_data \
/app/logs \
/app/final_reports \
/app/insight_engine_streamlit_reports \
/app/media_engine_streamlit_reports \
/app/query_engine_streamlit_reports \
/app/output \
/app/browser_data \
/app/vendor/mediacrawler/browser_data
EXPOSE 5000 8501 8502 8503
CMD ["python", "-m", "apps.web_api"]