Skip to content

Instantly share code, notes, and snippets.

@jesulink2514
Created August 1, 2022 01:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesulink2514/d1ff85b78b0c027ce833c6d45fa499cc to your computer and use it in GitHub Desktop.
Save jesulink2514/d1ff85b78b0c027ce833c6d45fa499cc to your computer and use it in GitHub Desktop.
.NET + MSSQL
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
# Update 'VARIANT' to pick a version of .NET: 3.1-focal, 6.0-focal
VARIANT: "6.0-focal"
# Optional version of Node.js
NODE_VERSION: "none"
volumes:
- ..:/workspace:cached
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
# Uncomment the next line to use a non-root user for all processes.
# user: vscode
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
db:
image: mcr.microsoft.com/mssql/server:2019-latest
restart: unless-stopped
environment:
SA_PASSWORD: P@ssw0rd
ACCEPT_EULA: Y
# Add "forwardPorts": ["1433"] to **devcontainer.json** to forward MSSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
volumes:
- ./mssql/bak/:/bak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment