meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| linux:debian:docker [2026/06/08 22:14] – removed - external edit (Unknown date) 127.0.0.1 | linux:debian:docker [2026/06/08 22:14] (current) – ↷ Page moved from os:linux:debian:docker to linux:debian:docker kilroy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Gitlab ===== | ||
| + | ==== Configure gitlab docker container on apache2 subdomain with ssl ==== | ||
| + | <code bash> | ||
| + | # Install everything: | ||
| + | apt-get install docker docker-compose python-certbot python-certbot-apache | ||
| + | </ | ||
| + | |||
| + | <file yml docker-compose.yml> | ||
| + | web: | ||
| + | image: ' | ||
| + | restart: always | ||
| + | hostname: ' | ||
| + | environment: | ||
| + | GITLAB_OMNIBUS_CONFIG: | ||
| + | external_url ' | ||
| + | # Add any other gitlab.rb configuration here, each on its own line | ||
| + | ports: | ||
| + | - ' | ||
| + | - ' | ||
| + | volumes: | ||
| + | - '/ | ||
| + | - '/ | ||
| + | - '/ | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | # launch container: | ||
| + | docker-compose up | ||
| + | |||
| + | # install certificate and add subdomain | ||
| + | certbot --apache | ||
| + | certbot certonly --apache --expand -d hostname.de -d gitlab.hostname.de | ||
| + | |||
| + | # rework and copy certificate into gitlab data storage: | ||
| + | cd / | ||
| + | cat cert.pem fullchain.crt > gitlab.hostname.de.crt | ||
| + | cp privkey.pem gitlab.hostname.de.key | ||
| + | mv gitlab.* / | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | <file bash apache-default.conf> | ||
| + | < | ||
| + | ServerName unknown | ||
| + | Redirect 200 / | ||
| + | ErrorDocument 200 "No such site." | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | < | ||
| + | ServerName hostname.de | ||
| + | ServerAdmin webmaster@hostname.de | ||
| + | |||
| + | # whatever you want apache to do | ||
| + | |||
| + | #Include conf-available/ | ||
| + | SSLCertificateFile / | ||
| + | SSLCertificateKeyFile / | ||
| + | Include / | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | |||
| + | # force ssl | ||
| + | < | ||
| + | ServerName hostname.de | ||
| + | ServerAdmin webmaster@hostname.de | ||
| + | |||
| + | RewriteEngine on | ||
| + | RewriteCond %{SERVER_NAME} =hostname.de | ||
| + | RewriteRule ^ https:// | ||
| + | |||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | <file bash gitlab.conf> | ||
| + | # this is probably redundant | ||
| + | < | ||
| + | ServerName gitlab.hostname.de | ||
| + | |||
| + | RewriteEngine On | ||
| + | RewriteCond %{HTTP_HOST} ^(.+)\.hostname\.de$ | ||
| + | RewriteRule ^(.*)$ https:// | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | ServerName gitlab.hostname.de | ||
| + | redirect / https:// | ||
| + | |||
| + | SSLCertificateFile / | ||
| + | SSLCertificateKeyFile / | ||
| + | Include / | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | </ | ||