diff --git a/Caddyfile b/Caddyfile index f68649e..6b57e87 100644 --- a/Caddyfile +++ b/Caddyfile @@ -1,3 +1,3 @@ -:80 { +healthcareinfra.soham901.me { reverse_proxy localhost:8000 } \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index a17f5b8..785256f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,17 @@ services: + caddy: + image: caddy:latest + restart: unless-stopped + ports: + - "80:80" + - "443:443" + - "443:443/udp" + volumes: + - ./Caddyfile:/etc/caddy/Caddyfile + - ./site:/srv + - caddy_data:/data + - caddy_config:/config + app: build: . ports: @@ -19,3 +32,5 @@ services: volumes: db-data: + caddy_data: + caddy_config: diff --git a/nginx.conf b/nginx.conf deleted file mode 100644 index b282eb8..0000000 --- a/nginx.conf +++ /dev/null @@ -1,29 +0,0 @@ -events { - worker_connections 1024; -} - -http { - upstream app { - server app:8000; - } - - server { - listen 80; - server_name ec2-13-126-120-181.ap-south-1.compute.amazonaws.com; - return 301 https://$server_name$request_uri; - } - - server { - listen 443 ssl; - server_name ec2-13-126-120-181.ap-south-1.compute.amazonaws.com; - - ssl_certificate /etc/nginx/ssl/fullchain.pem; - ssl_certificate_key /etc/nginx/ssl/privkey.pem; - - location / { - proxy_pass http://app; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - } - } -} \ No newline at end of file