Skip to content

Commit 59e1c38

Browse files
committed
feat(docker): add docker compose and docker files
1 parent 9424532 commit 59e1c38

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

backend/Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install system dependencies
6+
RUN apt-get update && apt-get install -y \
7+
build-essential \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Install Poetry
11+
RUN pip install poetry
12+
13+
# Copy application code
14+
COPY . .
15+
16+
# Configure poetry to not create a virtual environment
17+
RUN poetry config virtualenvs.create false
18+
19+
# Install dependencies
20+
RUN poetry install
21+
22+
# run migrations
23+
RUN make migrate
24+
25+
# Expose the port the app runs on
26+
EXPOSE 8000
27+
28+
# Command to run the application
29+
CMD ["poetry", "run", "uvicorn", "app.main:app", "--workers", "2", "--host", "0.0.0.0", "--port", "8000"]

docker-compose.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: "3.8"
2+
3+
services:
4+
backend:
5+
build:
6+
context: ./backend
7+
dockerfile: Dockerfile
8+
container_name: panda-etl-backend
9+
ports:
10+
- "5328:5328"
11+
volumes:
12+
- ./instance:/app/instance
13+
- ./uploads:/app/uploads
14+
- ./processed:/app/processed
15+
environment:
16+
- ENV=production
17+
restart: unless-stopped
18+
command: >
19+
sh -c "poetry run alembic upgrade head && poetry run uvicorn app.main:app --host 0.0.0.0 --port 5328"
20+
21+
frontend:
22+
build:
23+
context: ./frontend
24+
dockerfile: Dockerfile
25+
container_name: panda-etl-frontend
26+
ports:
27+
- "3000:3000"
28+
environment:
29+
- NODE_ENV=production
30+
depends_on:
31+
- backend
32+
restart: unless-stopped
33+
extra_hosts:
34+
- "host.docker.internal:host-gateway"

0 commit comments

Comments
 (0)