Commit e2d2d4f0 authored by Martin Mai's avatar Martin Mai
Browse files

init

parents
FROM alpine:3.5
ENV OPENSSL_VERSION 1.0.2e-r0
RUN apk --no-cache --update add \
ca-certificates \
caddy \
curl \
"openssl>=${OPENSSL_VERSION}"
EXPOSE 80 443 2015
ENTRYPOINT ["caddy"]
# change gitlab configuration
```
cp \
gitlab/volumes/etc/gitlab/gitlab.rb-dist \
gitlab/volumes/etc/gitlab/gitlab.rb
edit volumes/etc/gitlab/gitlab.rb
#or
#edit gitlab/init-config.sh
#bash gitlab/misc/init-config.sh
#hostname
edit caddy-conf/caddyfile
#perhaps set ip for ssh
edit gitlab/docker-compose.yml
# start reverse-proxy and gitlab
```
docker-compose up -d
```
docker-compose exec \
gitlab gitlab-ctl reconfigure
```
# change initial gitlab password (web interface)
initial value:
grep 'initial_root_password' gitlab/volumes/etc/gitlab/gitlab.rb
login with user "root"
#See https://caddyserver.com/docs/caddyfile
#https://gitlab.rz.uni-bamberg.de {
https://:443 {
#see https://caddyserver.com/docs/tls
tls self_signed
#tls off
#dfn-pki
##tls /data/cert.pem /data/key.pem
#letsencrypt
##tls your-mail@domain.de
log / /data/gitlab.log "[gitlab] - {when} - {remote} - {proto} {method} {path} - {status} {size}"
proxy / http://gitlab:80 {
transparent
websocket
}
}
#See https://caddyserver.com/docs/caddyfile
#https://gitlab.rz.uni-bamberg.de {
#https://:443 {
uniba_change_me_caddy_url {
#see https://caddyserver.com/docs/tls
tls self_signed
#tls off
#dfn-pki
##tls /data/cert.pem /data/key.pem
#letsencrypt
##tls your-mail@domain.de
log / /data/gitlab.log "[gitlab] - {when} - {remote} - {proto} {method} {path} - {status} {size}"
proxy / http://gitlab:80 {
transparent
websocket
}
}
version: "2"
networks:
caddynet:
driver: bridge
services:
caddy:
build:
context: .
dockerfile: Dockerfile-caddy
image: caddy
restart: always
cap_add:
- NET_BIND_SERVICE
user: root
networks:
- caddynet
ports:
#- example for specific IP "141.13.99.99:80:80"
- "80:80"
- "443:443"
command: -type http -port 80 -http2=false -conf /data/caddyfile
read_only: true
working_dir: /data
environment:
- CADDYPATH=/data
volumes:
- ./caddy-conf:/data:rw
gitlab:
extends:
file: gitlab/docker-compose.yml
service: gitlab
networks:
- caddynet
\ No newline at end of file
version: "2"
networks:
caddynet:
driver: bridge
services:
caddy:
build:
context: .
dockerfile: Dockerfile-caddy
image: caddy
restart: always
cap_add:
- NET_BIND_SERVICE
user: root
networks:
- caddynet
ports:
#- example for specific IP "141.13.99.99:80:80"
#- "80:80"
#- "443:443"
- "uniba_de_change_me_ports_80"
- "uniba_de_change_me_ports_443"
command: -type http -port 80 -http2=false -conf /data/caddyfile
read_only: true
working_dir: /data
environment:
- CADDYPATH=/data
volumes:
- ./caddy-conf:/data:rw
gitlab:
extends:
file: gitlab/docker-compose.yml
service: gitlab
networks:
- caddynet
\ No newline at end of file
version: '2'
services:
gitlab:
image: gitlab/gitlab-ce:8.14.5-ce.0
restart: always
expose:
- 22
- 80
- 443
ports:
#- "141.13.240.109:22:22"
- "uniba_de_change_me_ports"
volumes:
- ./volumes/etc/gitlab:/etc/gitlab
- ./volumes/var/opt/gitlab:/var/opt/gitlab
- ./volumes/var/log/gitlab:/var/log/gitlab
- ./volumes/root/uniba.de/share:/root/uniba.de/share
- ./volumes/.git:/.git
This diff is collapsed.
#!/bin/bash
#values for gitlab/volumes/etc/gitlab/gitlab.rb
initial_root_password=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;)
gitlab_email_reply_to="gitlab.rz@uni-bamberg.de"
gitlab_email_from="gitlab.rz@uni-bamberg.de"
smtp_address="smtp.uni-bamberg.de"
smtp_domain="uni-bamberg.de"
#uniba_de_mattermost_change_me_support_about_link
#uniba_de_mattermost_support_email
#values for gitlab/docker-compose.yml
gitlab_ports="141.13.240.122:22:22"
#values for docker-compose.yml
uniba_de_change_me_ports_80="80:80"
uniba_de_change_me_ports_443="443:443"
#values for caddy-conf/caddyfile
uniba_change_me_caddy_url="https://141.13.240.122:443"
######################
cd caddy-conf
cat caddyfile.dist > caddyfile
sed -i -e "s\
|"uniba_change_me_caddy_url"|"$uniba_change_me_caddy_url"|\
g" caddyfile
cat caddyfile | grep "$uniba_change_me_caddy_url"
cd ..
######################
cat docker-compose.yml.dist > docker-compose.yml
sed -i -e "s\
|"uniba_de_change_me_ports_80"|"$uniba_de_change_me_ports_80"|\
g" docker-compose.yml
cat docker-compose.yml | grep "$uniba_de_change_me_ports_80"
sed -i -e "s\
|"uniba_de_change_me_ports_443"|"$uniba_de_change_me_ports_443"|\
g" docker-compose.yml
cat docker-compose.yml | grep "$uniba_de_change_me_ports_443"
#######################
cd gitlab
cat docker-compose.yml.dist > docker-compose.yml
sed -i -e "s\
|"uniba_de_change_me_ports"|"$gitlab_ports"|\
g" docker-compose.yml
cat docker-compose.yml | grep "$gitlab_ports"
cd ..
#######################
cd gitlab/volumes/etc/gitlab
cat gitlab.rb-dist > gitlab.rb
sed -ie "s\
|"uniba_de_change_me_smtp_domain"|"$smtp_domain"|\
g" gitlab.rb
cat gitlab.rb | grep "smtp_domain"
sed -ie "s\
|"uniba_de_change_me_smtp_address"|"$smtp_address"|\
g" gitlab.rb
cat gitlab.rb | grep "smtp_address"
sed -ie "s\
|"uniba_de_change_me_external_url"|"https://gitlab-intern.rz.uni-bamberg.de"|\
g" gitlab.rb
cat gitlab.rb | grep "https://gitlab-intern.rz.uni-bamberg.de"
sed -ie "s\
|"uniba_de_change_me_gitlab_email_from"|"$gitlab_email_from"|\
g" gitlab.rb
cat gitlab.rb | grep "$gitlab_email_from"
sed -ie "s\
|"uniba_de_change_me_gitlab_email_reply_to"|"$gitlab_email_reply_to"|\
g" gitlab.rb
cat gitlab.rb | grep "$gitlab_email_reply_to"
sed -ie "s\
|"uniba_de_change_me_initial_root_password"|"$initial_root_password"|\
g" gitlab.rb
cat gitlab.rb | grep "$initial_root_password"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment