feat: add devcontainer
All checks were successful
Caddy Manager CI build / docker (push) Successful in 1m24s
All checks were successful
Caddy Manager CI build / docker (push) Successful in 1m24s
This commit is contained in:
48
.devcontainer/devcontainer.json
Normal file
48
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
|
||||||
|
{
|
||||||
|
"name": "C# (.NET)",
|
||||||
|
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||||
|
"image": "mcr.microsoft.com/devcontainers/dotnet:1-9.0",
|
||||||
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
|
// "features": {},
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
"forwardPorts": [
|
||||||
|
8080
|
||||||
|
],
|
||||||
|
"mounts": [
|
||||||
|
{
|
||||||
|
"source": "caddy-manager-data-protection",
|
||||||
|
"type": "volume",
|
||||||
|
"target": "/home/vscode/.aspnet/DataProtection-Keys"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "caddy-manager-configdir",
|
||||||
|
"type": "volume",
|
||||||
|
"target": "/home/vscode/caddy/config"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
// "postCreateCommand": "dotnet restore",
|
||||||
|
"postCreateCommand": {
|
||||||
|
"fixDataProtectionPerms": "sudo chown -R $(whoami): /home/vscode/.aspnet/DataProtection-Keys",
|
||||||
|
"fixCaddyConfigPerms": "sudo chown -R $(whoami): /home/vscode/caddy/config"
|
||||||
|
},
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
"customizations": {
|
||||||
|
"jetbrains": {
|
||||||
|
"backend": "Rider"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
|
||||||
|
},
|
||||||
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
// "remoteUser": "root"
|
||||||
|
"containerEnv": {
|
||||||
|
"Docker__CaddyContainerName": "caddy",
|
||||||
|
"Docker__DockerHost": "unix:///var/run/docker.sock",
|
||||||
|
"Caddy__ConfigDir": "/home/vscode/caddy/config",
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ EndProject
|
|||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EC202984-FC85-4101-B801-1E8AA4E9C4DD}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EC202984-FC85-4101-B801-1E8AA4E9C4DD}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
compose.yaml = compose.yaml
|
compose.yaml = compose.yaml
|
||||||
|
.devcontainer\devcontainer.json = .devcontainer\devcontainer.json
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
|
|||||||
12
compose.yaml
12
compose.yaml
@@ -1,6 +1,8 @@
|
|||||||
services:
|
services:
|
||||||
caddymanager:
|
caddy:
|
||||||
image: caddymanager
|
image: caddy:latest
|
||||||
build:
|
container_name: caddy
|
||||||
context: .
|
restart: always
|
||||||
dockerfile: CaddyManager/Dockerfile
|
network_mode: "host"
|
||||||
|
security_opt:
|
||||||
|
- label:disable
|
||||||
Reference in New Issue
Block a user