Skip to content

Commit 5d276a4

Browse files
authored
fix: use repo root as Docker build context (#2)
1 parent ee4e98a commit 5d276a4

5 files changed

Lines changed: 53 additions & 12 deletions

File tree

.dockerignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Keep the build context small now that it's the repo root.
2+
.git
3+
.github
4+
.gitignore
5+
.dockerignore
6+
7+
# Local-only state and docs
8+
data
9+
logo
10+
*.md
11+
LICENSE
12+
docker-compose.yml
13+
14+
# Python cruft
15+
**/__pycache__
16+
**/*.pyc
17+
**/*.pyo
18+
**/*.pyd
19+
**/*.egg-info
20+
**/.venv
21+
**/venv
22+
**/env
23+
**/.pytest_cache
24+
**/.coverage
25+
**/htmlcov
26+
**/.mypy_cache
27+
**/.dmypy.json
28+
**/.ipynb_checkpoints
29+
30+
# Secrets and env
31+
**/*.key
32+
**/*.pem
33+
**/secrets
34+
.env
35+
.env.*
36+
37+
# Editor / OS
38+
.DS_Store
39+
.idea
40+
.vscode

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
- name: Build and push backend image
121121
uses: docker/build-push-action@v6
122122
with:
123-
context: ./backend
123+
context: .
124124
file: ./backend/Dockerfile
125125
push: true
126126
platforms: linux/amd64,linux/arm64/v8

backend/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ FROM python:3.13-slim
22

33
WORKDIR /backend
44

5-
COPY requirements.txt .
5+
COPY backend/requirements.txt .
66
RUN pip install --no-cache-dir -r requirements.txt
77

8-
COPY app/ ./app/
8+
COPY backend/app/ ./app/
9+
COPY frontend/ /frontend/
910

1011
EXPOSE 8000
1112

backend/Dockerfile.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# Test image — mirrors the production Dockerfile, then layers the dev deps on
22
# top. Build it locally with:
3-
# docker build -f Dockerfile.test -t stackresume-tests .
3+
# docker build -f backend/Dockerfile.test -t stackresume-tests .
44
# Or just use the compose profile:
55
# docker compose --profile test up --build --abort-on-container-exit
66
FROM python:3.13-slim
77

88
WORKDIR /backend
99

1010
# Production deps first so the cache hit pattern matches the prod image.
11-
COPY requirements.txt requirements-dev.txt ./
11+
COPY backend/requirements.txt backend/requirements-dev.txt ./
1212
RUN pip install --no-cache-dir -r requirements-dev.txt
1313

14-
COPY app/ ./app/
15-
COPY tests/ ./tests/
16-
COPY pytest.ini .
14+
COPY backend/app/ ./app/
15+
COPY backend/tests/ ./tests/
16+
COPY backend/pytest.ini .
1717

1818
# Make sure no provider keys leak through the host shell.
1919
ENV OPENAI_API_KEY="" \

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
services:
22
backend:
33
build:
4-
context: ./backend
5-
dockerfile: Dockerfile
4+
context: .
5+
dockerfile: backend/Dockerfile
66
container_name: stackresume-backend
77
ports:
88
- "8000:8000"
@@ -67,8 +67,8 @@ services:
6767
tests:
6868
profiles: ["test"]
6969
build:
70-
context: ./backend
71-
dockerfile: Dockerfile.test
70+
context: .
71+
dockerfile: backend/Dockerfile.test
7272
container_name: stackresume-tests
7373
environment:
7474
# Hard-blank any provider keys so tests never accidentally hit a real LLM.

0 commit comments

Comments
 (0)