Skip to content

Instantly share code, notes, and snippets.

@EliasMasche
Last active August 19, 2024 01:12
Show Gist options
  • Select an option

  • Save EliasMasche/84fba5c9c5709b04a533f3a984f56d37 to your computer and use it in GitHub Desktop.

Select an option

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
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
#!/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"
@EliasMasche

Copy link
Copy Markdown
Author

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

@EliasMasche

EliasMasche commented Aug 14, 2024

Copy link
Copy Markdown
Author

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