dotenv -f .env run pytest app/tests/test_main.py
REDIS_SERVER=redis-server
REDIS_PASS=pass123
dotenv -f .env run uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
but need a local redis running
docker-compose up --build
nginx:
image: nginx:latest
volumes:
- ./nginx.http.config:/etc/nginx/nginx.conf
or using https, but first you have to create or obtain your own certificates and put on the directory certs with names server.crt
and server.key
nginx:
image: nginx:latest
volumes:
- ./nginx.https.config:/etc/nginx/nginx.conf
- ./certs:/etc/nginx/certs
openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.crt -days 365 --nodes -subj '/C=GR/O=fidemporiki/OU=it/CN=tsadimas.eu'i
openssl x509 -in server.crt -out server-crt.pem -outform PEM
openssl rsa -in server.key -out server-key.pem -outform PEM
kubectl create secret tls tls-secret --cert server-crt.pem --key server-key.pem
kubectl apply -f k8s/fastapi-ingress-ssl.yaml
NOTE: because it is self signed certificate add the following to /etc/hosts
127.0.0.1 tsadimas.eu