Skip to content

Commit

Permalink
Merge pull request #19 from vcon-dev/trafaek-reverse-proxy-updates
Browse files Browse the repository at this point in the history
Trafaek reverse proxy updates
  • Loading branch information
howethomas authored Nov 15, 2024
2 parents f4d4a2a + 64da623 commit 09500ef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 34 deletions.
41 changes: 9 additions & 32 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,18 @@ services:
- "${CONSERVER_EXTERNAL_PORT:-8000}:8000"
depends_on:
- redis
# - certbot
env_file:
- .env
networks:
- conserver
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`${DNS_HOST}`) && PathPrefix(`/api`)"
- "traefik.http.routers.api.entrypoints=websecure"
- "traefik.http.routers.api.tls.certresolver=myresolver"
- "traefik.http.services.api.loadbalancer.server.port=8000"
- "traefik.http.middlewares.strip-api-prefix.stripprefix.prefixes=/api"


redis:
image: "redis/redis-stack:latest"
Expand All @@ -52,34 +59,4 @@ services:
retries: 5
networks:
- conserver


# certbot:
# container_name: "certbot"
# image: certbot/certbot
# ports:
# - "80:80"
# volumes:
# - certbot-data:/etc/letsencrypt
# command: certonly --standalone --agree-tos --email ${CERTBOT_EMAIL} --no-self-upgrade --non-interactive -d ${SERVER_NAME}
# networks:
# - conserver

# nginx:
# container_name: "nginx"
# image: nginx:latest
# ports:
# - "443:443"
# volumes:
# - certbot-data:/etc/letsencrypt
# - ./nginx.conf:/etc/nginx/nginx.conf
# depends_on:
# - certbot
# networks:
# - conserver
# environment:
# - SERVER_NAME=${SERVER_NAME}

# volumes:
# certbot-data:


4 changes: 2 additions & 2 deletions server/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
)
from pydantic import BaseModel, ConfigDict
from dlq_utils import get_ingress_list_dlq_name
from settings import VCON_SORTED_SET_NAME, VCON_STORAGE, CONSERVER_API_TOKEN, CONSERVER_HEADER_NAME, CONSERVER_API_TOKEN_FILE
from settings import VCON_SORTED_SET_NAME, VCON_STORAGE, CONSERVER_API_TOKEN, CONSERVER_HEADER_NAME, CONSERVER_API_TOKEN_FILE, API_ROOT_PATH
from fastapi.security.api_key import APIKeyHeader
from fastapi import APIRouter
from fastapi import Security
Expand All @@ -34,7 +34,7 @@
logger.info("Api starting up")


app = FastAPI()
app = FastAPI(root_path=API_ROOT_PATH)
api_key_header = APIKeyHeader(name=CONSERVER_HEADER_NAME, auto_error=False)

api_keys = []
Expand Down
1 change: 1 addition & 0 deletions server/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@
VCON_SORTED_SET_NAME = os.getenv("VCON_SORTED_SET_NAME", "vcons")

CONSERVER_CONFIG_FILE = os.getenv("CONSERVER_CONFIG_FILE", "./example_config.yml")
API_ROOT_PATH = os.getenv("API_ROOT_PATH", "/api")

0 comments on commit 09500ef

Please sign in to comment.