Skip to content

Commit

Permalink
Merge pull request #42 from mbsantiago/fix/use_current_host_in_prod
Browse files Browse the repository at this point in the history
 Default API URL to Current Host in Production
  • Loading branch information
mbsantiago authored Nov 8, 2024
2 parents ec406fa + 38c03dc commit 351ff06
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ FROM python:3.12-slim-bookworm
# Install system dependencies, including libexpat1 and clean up the cache
RUN apt-get update && apt-get install -y --no-install-recommends \
libexpat1 \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*

# Copy the application from the builder
Expand Down
6 changes: 6 additions & 0 deletions back/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim

WORKDIR /code

# Install system dependencies, including libexpat1 and clean up the cache
RUN apt-get update && apt-get install -y --no-install-recommends \
libexpat1 \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*

RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
Expand Down
7 changes: 6 additions & 1 deletion front/src/app/api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import createAPI from "@/lib/api";

const baseURL =
process.env.NODE_ENV === "development"
? process.env.NEXT_PUBLIC_BACKEND_HOST || ""
: "";

const api = createAPI({
baseURL: `${process.env.NEXT_PUBLIC_BACKEND_HOST}`,
baseURL,
withCredentials: true,
});

Expand Down

0 comments on commit 351ff06

Please sign in to comment.