You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to limit, on docker compose file, cpu e mem usage
Docker Secrets
Don't store secrets on Env variable (docker inspect [image] show them) and if you copy files and delete theme ..pay attention to docker chache
@see Docker Secrets for docker compose
Where,
-t rsa : Specifies the type of key to create. The possible values are “rsa1” for protocol version 1 and “dsa”, “ecdsa”, “ed25519”, or “rsa” for protocol version 2.
-b 4096 : Specifies the number of bits in the key to create
-f ~/.ssh/vps-cloud.web-server.key : Specifies the filename of the key file.
-C "My web-server key" : Set a new comment.
To assign the permissions to the user, we create the file /etc/sudoers.d/90-gabri
vim /etc/sudoers.d/90-gabri
with the following content:
gabri ALL=(ALL) NOPASSWD:ALL
For additional security, we adjust the configuration of the SSH server. To do this we open /etc/ssh/sshd_config, delete the contents of the file and insert the configuration below instead:
Protocol 2
Port 44933
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
UsePrivilegeSeparation yes
KeyRegenerationInterval 3600
SyslogFacility AUTH
LogLevel INFO
PermitRootLogin no
StrictModes yes
IgnoreRhosts yes
RhostsRSAAuthentication no
HostbasedAuthentication no
PubkeyAuthentication yes
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding no
PrintMotd no
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
AllowUsers gabri
Depositing the public key
mkdir -p /home/gabri/.ssh
vim /home/gabri/.ssh/authorized_keys [insert the public key]
chmod 600 /home/gabri/.ssh/authorized_keys
chown gabri:gabri /home/gabri/.ssh/authorized_keys
Access to Docker
By default, Docker can only be used as root. In order use Docker (without sudo) the user 'holu' has to be a member of the 'docker' group.
sudo usermod -aG docker gabri
Note: Users in the 'docker' group effectively have root privileges
-p preserva le date di modifica
se si vuole copiare ricorsivamente usare -rp
Creating network to bridge all the containers
Creating network to bridge all the containers
docker network create nginx-proxy
From now on, we need to ensure that we’re always adding new containers to the nginx-proxy Docker network
In docker-compose we have /var/run/docker.sock:/tmp/docker.sock line accomplishes. Essentially, this gives any container access to the host’s Docker socket, which contains information about a variety of Docker events, such as creating a new container, or shutting one down.
Every time you add a container, nginx-proxy sees the event through the socket, automatically creates the configuration file needed to route traffic, and restarts nginx to make the changes available immediately. nginx-proxy looks for containers with the VIRTUAL_HOST variable enabled, so that’s critical to our operations moving forward.