Skip to content

Commit 61f7faa

Browse files
committed
ci: docker compose
1 parent 8d9356b commit 61f7faa

File tree

5 files changed

+64
-1
lines changed

5 files changed

+64
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/docker-compose.yml

docker-compose.yml.example

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
version: "3.8"
3+
4+
services:
5+
fast-api:
6+
build:
7+
context: ./spez-backend
8+
container_name: spezbe
9+
ports:
10+
- "8000:8000"
11+
environment:
12+
- DATABASE_URL=
13+
- SECRET_KEY=
14+
depends_on:
15+
- db
16+
nextjs:
17+
build:
18+
context: ./spez-frontend
19+
container_name: spezfe
20+
ports:
21+
- "3000:3000"
22+
environment:
23+
- NEXT_PUBLIC_SERVER_URL=
24+
depends_on:
25+
- fast-api
26+
db:
27+
image: postgres:14
28+
container_name: spez
29+
environment:
30+
- POSTGRES_USER=
31+
- POSTGRES_PASSWORD=
32+
- POSTGRES_DB=
33+
ports:
34+
- "5433:5433"
35+
volumes:
36+
- postgres_data:/var/lib/postgresql/data
37+
38+
volumes:
39+
postgres_data:
40+

spez-backend/.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DATABASE_URL=
2+
SECRET_KET=

spez-backend/Dockerfile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use an official Python runtime as a parent image
2+
FROM python:3.11-slim
3+
4+
# Set the working directory in the container
5+
WORKDIR /app
6+
7+
# Copy the requirements file to the container
8+
COPY requirements.txt .
9+
10+
# Install any necessary dependencies
11+
RUN pip install --no-cache-dir -r requirements.txt
12+
13+
# Copy the rest of the application code to the container
14+
COPY . .
15+
16+
# Expose the port FastAPI runs on
17+
EXPOSE 8000
18+
19+
# Command to run the FastAPI app with Uvicorn
20+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]

spez-frontend/src/components/LoginForm.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function LoginForm() {
2020
const body = new URLSearchParams();
2121
body.append('username', username);
2222
body.append('password', password);
23-
// console.log(body)
23+
console.log(body)
2424
// API call to authenticate using x-www-form-urlencoded
2525
try {
2626
const res = await authenticate(body.toString())

0 commit comments

Comments
 (0)