Skip to content

Commit 70c4d7e

Browse files
committed
chore(docker): add Dockerfile for backend and docker-compose
1 parent c9b590c commit 70c4d7e

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed

.dockerignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.git
2+
node_modules
3+
frontend/node_modules
4+
.venv
5+
__pycache__
6+
*.py[cod]
7+
*.log
8+
build
9+
frontend/build
10+
*.env
11+
env
12+
.env
13+
14+

backend/Dockerfile

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
FROM python:3.12-slim
2+
3+
ENV PYTHONDONTWRITEBYTECODE=1 \
4+
PYTHONUNBUFFERED=1
5+
6+
WORKDIR /app
7+
8+
# System deps for WeasyPrint (cairo/pango/gdk-pixbuf) and fonts
9+
RUN apt-get update && apt-get install -y --no-install-recommends \
10+
libcairo2 \
11+
libpango-1.0-0 \
12+
libpangoft2-1.0-0 \
13+
libgdk-pixbuf-2.0-0 \
14+
shared-mime-info \
15+
fonts-liberation \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
COPY backend/requirements.txt /app/backend/requirements.txt
19+
RUN pip install --no-cache-dir -r /app/backend/requirements.txt
20+
21+
COPY backend /app/backend
22+
23+
ENV TEST_MODE=true \
24+
FLASK_DEBUG=0
25+
26+
EXPOSE 5000
27+
WORKDIR /app/backend
28+
29+
CMD ["python", "pdf_server.py"]
30+
31+

docker-compose.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
services:
2+
backend:
3+
build:
4+
context: ./backend
5+
environment:
6+
TEST_MODE: "${TEST_MODE:-true}"
7+
FLASK_DEBUG: "0"
8+
API_KEY: "${API_KEY:-}"
9+
ports:
10+
- "5000:5000"
11+
12+
frontend:
13+
build:
14+
context: ./frontend
15+
args:
16+
REACT_APP_API_URL: "http://backend:5000"
17+
ports:
18+
- "3000:80"
19+
depends_on:
20+
- backend
21+
22+

0 commit comments

Comments
 (0)