Skip to content

Commit 8f28857

Browse files
committed
Correct env vars
1 parent 663fc7d commit 8f28857

File tree

7 files changed

+30
-22
lines changed

7 files changed

+30
-22
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,25 @@ Este archivo docker-compose.yml te permitirá levantar tanto el backend con Fast
115115

116116
kubectl create secret generic llm-service-token-secret --from-literal=SERVICE_TOKEN=myllservicetoken2024
117117

118+
# Desplegar el backend
119+
kubectl apply -f backend/k8s/deployment.yaml
120+
kubectl apply -f backend/k8s/service.yaml
121+
122+
# Desplegar el frontend
123+
kubectl apply -f frontend/k8s/deployment.yaml
124+
kubectl apply -f frontend/k8s/service.yaml
125+
126+
kubectl get services
127+
128+
129+
kubectl delete service chatllm-backendapi-service
130+
kubectl delete service chatllm-frontend-service
131+
132+
kubectl get deployments
133+
134+
kubectl delete deployment chatllm-backendapi-deployment
135+
kubectl delete deployment chatllm-frontend-deployment
136+
118137
export SERVICE_TOKEN=myllservicetoken2024
119138

120139
docker-compose up

backend/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ COPY ./api /api
1414
# Copy .env file into the container at /api
1515
COPY .env /api
1616

17+
# Export .env variables
18+
ENV $(cat .env | xargs)
19+
1720
# Expose the port the api runs in
1821
EXPOSE 8000
1922

backend/k8s/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: chatllm-backendapi--service
4+
name: chatllm-backendapi-service
55
spec:
66
selector:
77
app: chatllmapi

docker-compose-ghimages.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
environment:
99
- MODULE_NAME=api.main
1010
- VARIABLE_NAME=api
11-
- SERVICE_TOKEN=${SERVICE_TOKEN}
11+
1212

1313
frontend:
1414
image: ghcr.io/adribaeza/llm-tinyllama-frontend:latest
@@ -18,8 +18,4 @@ services:
1818
- "8501:8501"
1919
depends_on:
2020
- backend
21-
environment:
22-
- SERVICE_TOKEN=${SERVICE_TOKEN}
23-
24-
env_file:
25-
- .env
21+

docker-compose.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ services:
99
environment:
1010
- MODULE_NAME=api.main
1111
- VARIABLE_NAME=api
12-
- SERVICE_TOKEN=${SERVICE_TOKEN}
13-
env_file:
14-
- ./frontend/.env
12+
1513

1614
frontend:
1715
build:
@@ -21,8 +19,4 @@ services:
2119
ports:
2220
- "8501:8501"
2321
depends_on:
24-
- backend
25-
environment:
26-
- SERVICE_TOKEN=${SERVICE_TOKEN}
27-
env_file:
28-
- ./backend/.env
22+
- backend

frontend/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ RUN pip install --no-cache-dir -r requirements.txt
1414
# Copy .env file into the container at /api
1515
COPY .env /api
1616

17+
# Export .env variables
18+
ENV $(cat .env | xargs)
19+
1720
# Make port 8501 available to the world outside this container
1821
EXPOSE 8501
1922

frontend/Readme.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,3 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
8585

8686

8787

88-
# Desplegar el backend
89-
kubectl apply -f backend/k8s/backend-deployment.yaml
90-
kubectl apply -f backend/k8s/backend-service.yaml
91-
92-
# Desplegar el frontend
93-
kubectl apply -f frontend/k8s/frontend-deployment.yaml
94-
kubectl apply -f frontend/k8s/frontend-service.yaml

0 commit comments

Comments
 (0)