forked from azerothcore/azerothcore-wotlk
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(Docker/bash): docker-compose system rework (azerothcore#4488)
##⚠️ ATTENTION!⚠️ Upgrading procedure: **Database:** After this PR will be merged you need to backup your DB first (you can use the db-assembler or any mysql client to generate the dump) and restore it after. The reason is that we use now docker named volumes instead of binded ones to improve performance. **Conf & client data**: if you use the default configuration, both the etc and the data folder are now available inside the **/env/docker**. Finally, you can cleanup the /docker folder previously used by our system. ## Changes Proposed: This PR will implement the [devcontainer ](https://code.visualstudio.com/docs/remote/containers) feature for VSCode. Allowing us to develop and debug directly within the container in the same way on all OSes. * Implemented support for vscode dev-container feature by remote-extension suite * Docker performance optimizations for MacOS and non-linux hosts * Bash system improvements * Implemented first command using Deno runtime environment (typescript) and [commander.js] * Implemented wait mechanism for db_assembler * Implemented db migration command * possibility to run the authserver and worldserver with GDB using the integrated simple-restarter * Implemented docker multi-stage mechanism to use one single Dockerfile for all the services * client-data downloader now creates a placeholder to avoid downloading the same version of data files multiple times * deployment of pre-compiled docker images on [docker hub](https://hub.docker.com/u/acore), you can test them [here](https://github.com/azerothcore/acore-docker)
- Loading branch information
Showing
100 changed files
with
2,746 additions
and
776 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml. | ||
{ | ||
"name": "ac-dev-server", | ||
|
||
// Update the 'dockerComposeFile' list if you have more compose files or use different names. | ||
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. | ||
"dockerComposeFile": [ | ||
"../docker-compose.yml", | ||
"../docker-compose.override.yml", // needed until this issue will be solved: https://github.com/microsoft/vscode-remote-release/issues/1080 | ||
"docker-compose.yml" | ||
], | ||
// The 'service' property is the name of the service for the container that VS Code should | ||
// use. Update this value and .devcontainer/docker-compose.yml to the real service name. | ||
"service": "ac-dev-server", | ||
|
||
// The optional 'workspaceFolder' property is the path VS Code should open by default when | ||
// connected. This is typically a file mount in .devcontainer/docker-compose.yml | ||
"workspaceFolder": "/azerothcore", | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": null | ||
}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": [ | ||
"notskm.clang-tidy", | ||
"xaver.clang-format", | ||
"bbenoist.doxygen", | ||
"ms-vscode.cpptools", | ||
"austin.code-gnu-global", | ||
"twxs.cmake", | ||
"mhutchie.git-graph", | ||
"github.vscode-pull-request-github", | ||
"eamodio.gitlens", | ||
"cschlosser.doxdocgen" | ||
], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Uncomment the next line if you want start specific services in your Docker Compose config. | ||
"runServices": ["ac-dev-server", "ac-database"], | ||
|
||
// Uncomment the next line if you want to keep your containers running after VS Code shuts down. | ||
// "shutdownAction": "none", | ||
|
||
// Uncomment the next line to run commands after the container is created - for example installing curl. | ||
// "postCreateCommand": "apt-get update && apt-get install -y curl", | ||
|
||
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "acore" | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: '3.9' | ||
services: | ||
# Update this to the name of the service you want to work with in your docker-compose.yml file | ||
ac-dev-server: | ||
# If you want add a non-root user to your Dockerfile, you can use the "remoteUser" | ||
# property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks, | ||
# debugging) to execute as the user. Uncomment the next line if you want the entire | ||
# container to run as this user instead. Note that, on Linux, you may need to | ||
# ensure the UID and GID of the container user you create matches your local user. | ||
# See https://aka.ms/vscode-remote/containers/non-root for details. | ||
# | ||
# user: vscode | ||
|
||
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer | ||
# folder. Note that the path of the Dockerfile and context is relative to the *primary* | ||
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile" | ||
# array). The sample below assumes your primary file is in the root of your project. | ||
# | ||
# build: | ||
# context: . | ||
# dockerfile: .devcontainer/Dockerfile | ||
|
||
#volumes: | ||
# Update this to wherever you want VS Code to mount the folder of your project | ||
#- .:/workspace:cached | ||
|
||
# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details. | ||
# - /var/run/docker.sock:/var/run/docker.sock | ||
|
||
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust. | ||
# cap_add: | ||
# - SYS_PTRACE | ||
# security_opt: | ||
# - seccomp:unconfined | ||
tty: true |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
build*/ | ||
var/* | ||
data/contrib/* | ||
data/doc/* | ||
conf/* | ||
!conf/dist | ||
docker/worldserver/data/* | ||
docker/build/cache | ||
/cmake-build-debug/* | ||
/build*/ | ||
/var/* | ||
/env/dist/* | ||
/env/user/* | ||
/env/docker/data/* | ||
/env/docker/logs/* | ||
/env/docker/etc/* | ||
!/env/docker/etc/authserver.conf.dockerdist | ||
!/env/docker/etc/worldserver.conf.dockerdist | ||
/.env* | ||
.idea | ||
cmake-build-debug/* |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "deps/git-subrepo"] | ||
path = deps/git-subrepo | ||
url = https://github.com/ingydotnet/git-subrepo.git |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"recommendations": [ | ||
"ms-vscode-remote.remote-containers", | ||
"notskm.clang-tidy", | ||
"xaver.clang-format", | ||
"bbenoist.doxygen", | ||
"ms-vscode.cpptools", | ||
"austin.code-gnu-global", | ||
"twxs.cmake", | ||
"mhutchie.git-graph", | ||
"github.vscode-pull-request-github", | ||
"eamodio.gitlens", | ||
"cschlosser.doxdocgen" | ||
] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Linux/Docker debug", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "/azerothcore/env/dist/bin/worldserver", | ||
"cwd": "/azerothcore", | ||
"args": [], | ||
"environment": [], | ||
"externalConsole": false, | ||
"sourceFileMap": { | ||
"/azerothcore": "${workspaceFolder}" | ||
}, | ||
"linux": { | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "/usr/bin/gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": false | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"name": "(docker run) Pipe Launch", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "/azerothcore/env/dist/bin/worldserver", | ||
"cwd": "/azerothcore", | ||
"args": [], | ||
"environment": [], | ||
"externalConsole": true, | ||
"pipeTransport": { | ||
"debuggerPath": "/usr/bin/gdb", | ||
"pipeProgram": "docker-compose", | ||
"pipeArgs": [ | ||
"exec", "-T", "ac-worldserver", "sh", "-c" | ||
], | ||
"pipeCwd": "${workspaceFolder}" | ||
}, | ||
"sourceFileMap": { | ||
"/azerothcore": "${workspaceFolder}" | ||
}, | ||
"linux": { | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "/usr/bin/gdb", | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": false | ||
} | ||
] | ||
}, | ||
"osx": { | ||
"MIMode": "lldb" | ||
}, | ||
"windows": { | ||
"MIMode": "gdb", | ||
"miDebuggerPath": "C:\\MinGw\\bin\\gdb.exe" | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.