Last active
August 19, 2024 01:12
-
-
Save EliasMasche/84fba5c9c5709b04a533f3a984f56d37 to your computer and use it in GitHub Desktop.
Docker compose file for MS-SQL Server 2022 - It is required to create the /mssql folder with its subdirectories /data - /log - /secrets from the termination and assign chown permissions to the corresponding user - Use dockge
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.8" | |
services: | |
mssql: | |
container_name: mssql-db | |
hostname: mssql-db | |
user: 10001:10001 | |
image: mcr.microsoft.com/mssql/server:2022-latest | |
environment: | |
- ACCEPT_EULA='Y' | |
- MSSQL_SA_PASSWORD=yourPassw0rd- | |
- MSSQL_DATA_DIR=/var/opt/mssql/data | |
- MSSQL_PID=Express | |
- MSSQL_TCP_PORT= 1433 | |
ports: | |
- 1433:1433 | |
volumes: | |
- /mssql/data:/var/opt/mssql/data | |
- /mssql/log:/var/opt/mssql/log | |
- /mssql/secrets:/var/opt/mssql/secrets | |
networks: | |
- dockge_default | |
restart: unless-stopped | |
networks: | |
dockge_default: | |
external: true |
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 | |
sudo mkdir -p /mssql/data | |
sudo mkdir -p /mssql/log | |
sudo mkdir -p /mssql/secrets | |
sudo chown -R 10001:10001 /mssql | |
sudo chown -R 10001:10001 /mssql/data | |
sudo chown -R 10001:10001 /mssql/log | |
sudo chown -R 10001:10001 /mssql/secrets | |
echo "Directories created and ownership updated" |
Optional .sh
script for faster and under one command all config of directories and ownership
To make the script executable chmod +x setup_mssql.sh
and run sudo ./setup_mssql.sh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Docker compose file for MS-SQL Server 2022 - It is required to create the /mssql folder with its subdirectories /data - /log - /secrets from the terminator and assign chown permissions to the corresponding user - Use dodge