Skip to content

Commit 3334ac1

Browse files
committedFeb 18, 2025
fix(docker): temp - use hard code path for middleware to read from other docker container
1 parent 165d421 commit 3334ac1

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed
 

Diff for: ‎backend/Dockerfile

-8
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ FROM python:3.11-slim
22

33
WORKDIR /app
44

5-
# Install system dependencies
6-
RUN apt-get update && apt-get install -y \
7-
build-essential \
8-
&& rm -rf /var/lib/apt/lists/*
9-
105
# Install Poetry
116
RUN pip install poetry
127

@@ -19,9 +14,6 @@ RUN poetry config virtualenvs.create false
1914
# Install dependencies
2015
RUN poetry install
2116

22-
# run migrations
23-
RUN make migrate
24-
2517
# Expose the port the app runs on
2618
EXPOSE 8000
2719

Diff for: ‎frontend/src/middleware.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
import { NextResponse } from "next/server";
22
import type { NextRequest } from "next/server";
3-
import { GetAPIKey } from "@/services/user";
43
import localStorage from "@/lib/localStorage";
4+
import { APIKeyData } from "./interfaces/user";
5+
import axios from "axios";
56

67
export async function middleware(request: NextRequest) {
78
let apiKey = null;
89
try {
9-
apiKey = await GetAPIKey();
10+
// Hardcoded for now for the docker
11+
const response = await axios.get<{ data: APIKeyData }>(
12+
`http://backend:5328/v1/user/get-api-key`
13+
);
14+
15+
apiKey = { data: { api_key: response.data.data.key } };
1016
} catch (error) {
1117
console.error("Error fetching API key:", error);
1218
return NextResponse.redirect(new URL("/api-key-setup", request.url));

0 commit comments

Comments
 (0)