config
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| config [2018/03/04 10:47] – fe80:a032:fcd2:21e3:d6a9:04ef:17ba:9974 | config [2024/04/05 07:48] (current) – A User Not Logged in | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Systemd ====== | ||
| + | |||
| + | |||
| + | |||
| ====== Docker ====== | ====== Docker ====== | ||
| + | |||
| pull from proxy: | pull from proxy: | ||
| - | ``` | + | < |
| mkdir -p / | mkdir -p / | ||
| + | cd / | ||
| cat > http-proxy.conf <<EOF | cat > http-proxy.conf <<EOF | ||
| Environment=" | Environment=" | ||
| Line 11: | Line 18: | ||
| systemctl daemon-reload | systemctl daemon-reload | ||
| systemctl restart docker.service | systemctl restart docker.service | ||
| - | ``` | + | cd - |
| - | ====== Caddy ====== | + | |
| - | systemd service: | + | </ |
| + | use docker hub mirrors: | ||
| + | < | ||
| + | mkdir -p /etc/docker | ||
| + | cat > / | ||
| + | { | ||
| + | " | ||
| + | } | ||
| + | EOF | ||
| + | sudo systemctl restart docker.service | ||
| + | </ | ||
| - | ``` | + | add current user to docker group: |
| - | + | ||
| - | [Unit] | + | |
| - | Description=Caddy HTTP/2 web server | + | |
| - | Documentation=https:// | + | |
| - | After=network-online.target | + | |
| - | Wants=network-online.target systemd-networkd-wait-online.service | + | |
| - | + | ||
| - | [Service] | + | |
| - | Restart=on-abnormal | + | |
| - | + | ||
| - | ; User and group the process will run as. | + | |
| - | User=root | + | |
| - | Group=root | + | |
| - | + | ||
| - | ; Letsencrypt-issued certificates will be written to this directory. | + | |
| - | Environment=CADDYPATH=/ | + | |
| - | + | ||
| - | ; Always set " | + | |
| - | ExecStart=/ | + | |
| - | ExecReload=/ | + | |
| - | + | ||
| - | ; Use graceful shutdown with a reasonable timeout | + | |
| - | KillMode=mixed | + | |
| - | KillSignal=SIGQUIT | + | |
| - | TimeoutStopSec=5s | + | |
| - | + | ||
| - | ; Limit the number of file descriptors; | + | |
| - | LimitNOFILE=1048576 | + | |
| - | ; Unmodified caddy is not expected to use more than that. | + | |
| - | LimitNPROC=512 | + | |
| - | + | ||
| - | ; Use private /tmp and /var/tmp, which are discarded after caddy stops. | + | |
| - | # | + | |
| - | ; Use a minimal /dev | + | |
| - | # | + | |
| - | ; Hide /home, /root, and /run/user. Nobody will steal your SSH-keys. | + | |
| - | # | + | |
| - | ; Make /usr, /boot, /etc and possibly some more folders read-only. | + | |
| - | ProtectSystem=full | + | |
| - | ; except / | + | |
| - | ; This merely retains r/w access rights, it does not add any new. Must still be writable on the host! | + | |
| - | ReadWriteDirectories=/ | + | |
| - | ; The following additional security directives only work with systemd v229 or later. | + | sudo usermod -aG docker $USER |
| - | ; They further restrict privileges that can be gained by caddy. Uncomment if you like. | + | |
| - | ; Note that you may have to add capabilities required by any plugins in use. | + | install apps |
| - | ; | + | |
| - | ; | + | |
| - | ; | + | |
| - | [Install] | + | docker run --name mysql -p 3306:3306 -v $PWD/ |
| - | WantedBy=multi-user.target | + | docker run -it -v ~/ |
| - | ``` | ||
config.1520160430.txt.gz · Last modified: by fe80:a032:fcd2:21e3:d6a9:04ef:17ba:9974
