Skip to content

Instantly share code, notes, and snippets.

@Alexlambertz
Last active September 3, 2022 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Alexlambertz/d2f7aeaca8d4838b819f64c6106148f3 to your computer and use it in GitHub Desktop.
Save Alexlambertz/d2f7aeaca8d4838b819f64c6106148f3 to your computer and use it in GitHub Desktop.
Setup Apache Guacamole using docker-compose
POSTGRES_USER=gua
POSTGRES_PASSWORD=<PASSWORD>
POSTGRES_DB=gua
version: "3.9"
services:
app:
image: guacamole/guacamole
restart: always
ports:
- "127.0.0.1:8080:8080"
volumes:
- "./config:/config"
environment:
- POSTGRES_DATABASE=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- GUACD_HOSTNAME=guacd
- POSTGRES_HOSTNAME=postgres
guacd:
image: guacamole/guacd
restart: always
postgres:
image: postgres
restart: always
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- PGDATA=/var/lib/postgresql/data
volumes:
- "./data:/var/lib/postgresql/data"
upstream application {
server localhost:8080;
}
server {
# The host name to respond to
server_name sub.domain.tld;
# disable cache
# add_header Cache-Control "no-cache, must-revalidate, max-age=0";
# change header values
location / {
proxy_pass http://application;
proxy_pass_request_headers on;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect $scheme://$host:8080 $scheme://$host:80;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_http_version 1.1;
}
# custom logs
access_log /var/log/nginx/sub.domain.tld.access.log;
error_log /var/log/nginx/sub.domain.tld.error.log;
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment