diff --git a/dev-env/caddy/Caddyfile b/dev-env/caddy/Caddyfile new file mode 100644 index 000000000..70e6904d2 --- /dev/null +++ b/dev-env/caddy/Caddyfile @@ -0,0 +1,12 @@ +# This configuration is intended to be used with Caddy, a very small high perf proxy. +# It will serve the application containers Payara Admin GUI via HTTP instead of HTTPS, +# avoiding the trouble of self signed certificates for local development. + +:4848 { + reverse_proxy https://dataverse:4848 { + transport http { + tls_insecure_skip_verify + } + header_down Location "^https://" "http://" + } +} diff --git a/dev-env/docker-compose-dev.yml b/dev-env/docker-compose-dev.yml index 4f5184c8b..f0c82bea6 100644 --- a/dev-env/docker-compose-dev.yml +++ b/dev-env/docker-compose-dev.yml @@ -43,6 +43,7 @@ services: restart: on-failure user: payara environment: + SKIP_DEPLOY: 1 dataverse_files_storage__driver__id: s3 DATAVERSE_DB_HOST: postgres DATAVERSE_DB_PASSWORD: secret @@ -77,7 +78,10 @@ services: # This is necessary because the dev_nginx proxy is placed on top of the Dataverse service, making those URLs unreachable unless this port is exposed. # This workaround is only necessary and intended for the local dev environment and will not be used in the remote environment, where we use a production DNS. ports: - - '8080:8080' + - "8080:8080" # HTTP (Dataverse Application) + - "4949:4848" # HTTPS (Payara Admin Console) + - "9009:9009" # JDWP + - "8686:8686" # JMX networks: - dataverse depends_on: @@ -93,6 +97,24 @@ services: mem_reservation: 1024m privileged: false + # This proxy configuration is only intended to be used for development purposes! + # DO NOT USE IN PRODUCTION! HIGH SECURITY RISK! + dev_proxy: + image: caddy:2-alpine + # The command below is enough to enable using the admin gui, but it will not rewrite location headers to HTTP. + # To achieve rewriting from https:// to http://, we need a simple configuration file + #command: ["caddy", "reverse-proxy", "-f", ":4848", "-t", "https://dataverse:4848", "--insecure"] + command: ["caddy", "run", "-c", "/Caddyfile"] + ports: + - "4848:4848" # Will expose Payara Admin Console (HTTPS) as HTTP + restart: always + volumes: + - ./caddy/Caddyfile:/Caddyfile:ro + depends_on: + - dev_dataverse + networks: + - dataverse + dv_initializer: container_name: 'dv_initializer' image: gdcc/configbaker:unstable diff --git a/dev-env/run-env.sh b/dev-env/run-env.sh index f8014c429..f92232b77 100755 --- a/dev-env/run-env.sh +++ b/dev-env/run-env.sh @@ -14,4 +14,4 @@ echo "INFO - Removing current environment if exists..." ./rm-env.sh echo "INFO - Running docker containers..." -docker compose -f "./docker-compose-dev.yml" up -d --build +SKIP_DEPLOY=1 docker compose -f "./docker-compose-dev.yml" up -d --build