diff --git a/proxy/nginx/conf.d/wallabag.conf b/proxy/nginx/conf.d/wallabag.conf new file mode 100644 index 0000000..69f78c0 --- /dev/null +++ b/proxy/nginx/conf.d/wallabag.conf @@ -0,0 +1,33 @@ +# HTTP configuration +# -- Redirect all HTTP requests to HTTPS port + +server { + listen 80; # HTTP port + server_name wallabag.systemsobscure.net; + location / { + return 301 https://$host$request_uri; # Variable is a placeholder for all requests to the server name + } +} + +# HTTPS configuration + +server { + listen 443 ssl; + server_name wallabag.systemsobscure.net; + + # SSL configuration + ssl_certificate /etc/letsencrypt/live/systemsobscure.net/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/systemsobscure.net/privkey.pem; + + # Security headers + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + # Proxy Configuration + location / { + proxy_pass http://wallabag:80; + 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/services/wallabag/docker-compose.yml b/services/wallabag/docker-compose.yml new file mode 100644 index 0000000..8e22a18 --- /dev/null +++ b/services/wallabag/docker-compose.yml @@ -0,0 +1,50 @@ +services: + wallabag: + image: wallabag/wallabag:latest + container_name: wallabag + restart: unless-stopped + volumes: + - wallabag_images:/var/www/wallabag/web/assets/images + - wallabag_data:/var/www/wallabag/data + ports: + - "8001:80" + networks: + - default + - web + depends_on: + - db + environment: + - SYMFONY__ENV__DATABASE_PASSWORD=${WALLABAG_CLIENT_PASSWORD} # wallabag client connection to DB + - SYMFONY__ENV__FROM_EMAIL=${WALLABAG_CLIENT_EMAIL} # not a login email + - SYMFONY__ENV__DOMAIN_NAME=https://wallabag.systemsobscure.net + - SYMFONY__ENV__DATABASE_DRIVER=pdo_mysql + - SYMFONY__ENV__DATABASE_HOST=db + - SYMFONY__ENV__DATABASE_PORT=3306 + - SYMFONY__ENV__DATABASE_NAME=wallabag + - SYMFONY__ENV__DATABASE_USER=wallabag + - SYMFONY__ENV__DATABASE_CHARSET=utf8mb4 + - SYMFONY__ENV__SERVER_NAME="Your Wallabag Instance" + - SYMFONY__ENV__FOSUSER_REGISTRATION=false + - SYMFONY__ENV__FOSUSER_CONFIRMATION=false + + db: + image: mariadb:10.5 + container_name: wallabag_db + environment: + - MYSQL_ROOT_PASSWORD=${WALLABAG_DB_ROOT_PASSWORD} + - MYSQL_DATABASE=wallabag + - MYSQL_USER=wallabag + - MYSQL_PASSWORD=${WALLABAG_DB_USER_PASSWORD} + volumes: + - wallabag_db:/var/lib/mysql + restart: unless-stopped + +volumes: + wallabag_data: + wallabag_images: + wallabag_db: + +networks: + default: + web: + external: true