-
-
Save pmcfernandes/fe84a0067d466a5083778350ad7397fd to your computer and use it in GitHub Desktop.
create docker in ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# place here variables | |
SQLSEVER_PORT=1454 | |
PARISH_SLUG=xpto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.2' | |
services: | |
duplicati: | |
image: 'linuxserver/duplicati' | |
restart: unless-stopped | |
networks: | |
- fresoft | |
ports: | |
- '8200:8200' | |
environment: | |
- PUID=1000 | |
- PGID=1000 | |
- TZ=Etc/UTC | |
volumes: | |
- /:/source | |
- /shared/BackupsSQL:/backups | |
- duplicati_config:/config | |
samba: | |
image: 'pwntr/samba-alpine:latest' | |
restart: unless-stopped | |
network_mode: "host" | |
volumes: | |
- /shared:/shared | |
- samba_config:/config | |
networks: | |
fresoft: | |
name: fresoft | |
volumes: | |
duplicati_config: | |
name: duplicati_config | |
samba_config: | |
name: samba_config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.2' | |
services: | |
mssql: | |
image: 'mcr.microsoft.com/mssql/server:2022-latest' | |
restart: unless-stopped | |
networks: | |
- ${PARISH_SLUG} | |
ports: | |
- '${SQLSEVER_PORT}:1433' | |
environment: | |
- ACCEPT_EULA=Y | |
- MSSQL_COLLATION=Latin1_General_CI_AS | |
- MSSQL_SA_PASSWORD=fre@2007@ | |
volumes: | |
- /var/mssql-data/${PARISH_SLUG}:/var/opt/mssql | |
networks: | |
${PARISH_SLUG}: | |
name: ${PARISH_SLUG} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
adduser pedro | |
usermod -aG sudo pedro | |
# Add Docker's official GPG key: | |
apt-get update | |
apt-get install ca-certificates curl gnupg | |
install -m 0755 -d /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
chmod a+r /etc/apt/keyrings/docker.gpg | |
# Add the repository to Apt sources: | |
echo \ | |
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ | |
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ | |
tee /etc/apt/sources.list.d/docker.list > /dev/null | |
apt-get update | |
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
docker volume create portainer_data | |
docker run -d -p 9000:9000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ee:latest | |
mkdir /shared | |
mkdir /shared/BackupsSQL | |
chmod -R a+rwX /shared/BackupsSQL | |
ufw default deny incoming | |
ufw default allow outgoing | |
ufw allow from 10.0.0.0/24 | |
ufw allow ssh | |
ufw allow 9000/tcp | |
ufw enable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment