diff --git a/ckan-backend-dev/.env.example b/ckan-backend-dev/.env.example index aca3aff9d..4f5b4fe66 100644 --- a/ckan-backend-dev/.env.example +++ b/ckan-backend-dev/.env.example @@ -132,8 +132,8 @@ CKAN__CORS__ORIGIN_ALLOW_ALL = True # Frontend Creds NEXTAUTH_SECRET=secret NEXTAUTH_URL=http://frontend:3000 -CKAN_URL=http://ckan-dev:5000/private-admin/en -NEXT_PUBLIC_CKAN_URL=http://ckan-dev:5000/private-admin/en +CKAN_URL=http://ckan-dev:3001/private-admin/en +NEXT_PUBLIC_CKAN_URL=http://ckan-dev:3001/private-admin/en NEXT_PUBLIC_NEXTAUTH_URL=http://frontend:3000 NEXT_PUBLIC_GTM_ID=GTM-XXXXXX NEXT_PUBLIC_HOTJAR_ID=xxxxxxx diff --git a/ckan-backend-dev/ckan/setup/nginx.conf b/ckan-backend-dev/ckan/setup/nginx.conf new file mode 100644 index 000000000..71c3685f0 --- /dev/null +++ b/ckan-backend-dev/ckan/setup/nginx.conf @@ -0,0 +1,27 @@ +server { + listen 3001; + + location /private-admin/ { + proxy_pass http://ckan-dev:5000/private-admin/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location /api/action { + proxy_pass http://ckan-dev:5000/api/3/action; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location / { + proxy_pass http://host.docker.internal:3000/; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} diff --git a/ckan-backend-dev/docker-compose.dev.yml b/ckan-backend-dev/docker-compose.dev.yml index 1077a1736..78709a70c 100755 --- a/ckan-backend-dev/docker-compose.dev.yml +++ b/ckan-backend-dev/docker-compose.dev.yml @@ -179,3 +179,16 @@ services: restart: unless-stopped healthcheck: test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8025/"] + + nginx: + image: nginx:latest + container_name: nginx-redirect + ports: + - "3001:3001" + volumes: + - ./ckan/setup/nginx.conf:/etc/nginx/conf.d/default.conf + depends_on: + - ckan-dev + restart: unless-stopped + extra_hosts: + - "host.docker.internal:host-gateway"