Created
August 24, 2021 15:09
-
-
Save dalmosantos/82eb58036158ab346bd294efb29fb35a to your computer and use it in GitHub Desktop.
rundeck-over-http
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
rundeck: | |
image: ${RUNDECK_IMAGE:-rundeck/rundeck:3.4.3} | |
container_name: rundeck | |
hostname: rundeck.lab.local | |
volumes: | |
- ./rundeck/data:/home/rundeck/server/data | |
- ./rundeck/home/rundeck/configs:/home/rundeck/configs | |
- ./rundeck/rundeck_plugins:/opt/rundeck-plugins | |
- ./rundeck/rundeck_config:/home/rundeck/etc/rundeck | |
- ./rundeck/rundeck_storage:/home/rundeck/var/lib/storage | |
- ./rundeck/rundeck_tmp:/home/rundeck/var/rundeck | |
links: | |
- mysql | |
environment: | |
RUNDECK_GRAILS_URL: 'http://rundeck.lab.local' | |
RUNDECK_DATABASE_DRIVER: org.mariadb.jdbc.Driver | |
RUNDECK_DATABASE_USERNAME: rundeck | |
RUNDECK_DATABASE_PASSWORD: rundeck | |
RUNDECK_DATABASE_URL: jdbc:mariadb://mysql/rundeck?autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true | |
RUNDECK_SERVER_ADDRESS: 0.0.0.0 | |
RUNDECK_FEATURE_UINEXT_NAME: uiNext | |
RUNDECK_FEATURE_UINEXT_ENABLED: 'true' | |
RUNDECK_SERVER_CONTEXTPATH: /rundeck | |
RUNDECK_SERVER_FORWARDED: 'true' | |
ports: | |
- 4440:4440 | |
mysql: | |
container_name: mysql | |
image: mysql:8 | |
expose: | |
- 3306 | |
cap_add: | |
- SYS_NICE # CAP_SYS_NICE reduces error messages in console | |
environment: | |
- MYSQL_ROOT_PASSWORD=root | |
- MYSQL_DATABASE=rundeck | |
- MYSQL_USER=rundeck | |
- MYSQL_PASSWORD=rundeck | |
volumes: | |
- ./mysql/data:/var/lib/mysql | |
nginx: | |
image: nginx | |
links: | |
- rundeck | |
volumes: | |
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro | |
ports: | |
- 80:80 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
events { | |
worker_connections 1024; | |
} | |
http { | |
# Route all HTTP traffic through HTTPS | |
# ==================================== | |
server { | |
listen 80; | |
server_name localhost; | |
#===========================================================================# | |
# #Rundeck | |
location ~ /rundeck { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
add_header 'Access-Control-Allow-Credentials' 'true'; | |
add_header 'Access-Control-Allow-Methods' 'GET, HEAD, OPTIONS, POST, PUT'; | |
add_header 'Access-Control-Allow-Headers' 'Origin, X-Requested-With, Content-Type, Origin, User-Agent, If-Modified-Since, Cache-Control, Accept'; | |
add_header 'Access-Control-Max-Age' 1728000; | |
add_header 'Content-Length' 0; | |
return 200; | |
} | |
# rewrite ^/rundeck(.*) /$1 break; | |
proxy_pass http://rundeck.lab.local:4440; | |
proxy_redirect http://rundeck.lab.local:4440 /rundeck; | |
proxy_read_timeout 900; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Host $host:$server_port; | |
proxy_set_header X-Forwarded-Server $host; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header User-Agent $http_user_agent; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment