Skip to content

Commit 78fef11

Browse files
committed
feat(envs): change env file
1 parent 43083fd commit 78fef11

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

backend/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,8 @@ FROM ghcr.io/astral-sh/uv:python3.13-bookworm
22

33
RUN apt update && apt install --no-install-recommends -y curl
44
WORKDIR /app
5-
COPY ./uv.lock ./pyproject.toml .
5+
COPY ./backend/uv.lock ./backend/pyproject.toml .
66
RUN uv sync --frozen
7+
COPY ./envs/backend.env /opt/.env
8+
COPY ./backend .
9+
ENTRYPOINT ["fastapi", "run", "--root-path=/api"]

backend/config.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33

44
class Settings(BaseSettings):
5-
model_config = SettingsConfigDict(env_file="/opt/.env", extra="ignore")
5+
model_config = SettingsConfigDict(
6+
env_file="/opt/.env",
7+
env_ignore_empty=True,
8+
extra="ignore",
9+
)
610

711
model: str = "gpt-4o-mini-2024-07-18"
812
openai_api_key: str = ""

compose-dev.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ services:
22
backend:
33
image: backend:dev
44
build:
5-
context: ./backend
5+
context: .
6+
dockerfile: ./backend/Dockerfile
67
entrypoint: bash -c "sleep infinity"
7-
env_file:
8-
- ./envs/backend.env
98
volumes:
109
- ./backend:/app

0 commit comments

Comments
 (0)