mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-11-10 20:34:53 +08:00
feat(CORE): docker permissions and rework (#13454)
- fix docker permissions with mounted volumes on new docker versions (https://github.com/docker/desktop-linux/issues/31) - fix ac-tools image - cleanup unused env - add `cap_add: SYS_NICE` to allow setting process high priority - fix ccache in docker - allow to switch between root user (default) to acore user in any container - fix cache of the downloaded client data - split docker github actions in 2 parts - versioning mysql images - performance improvements
This commit is contained in:
parent
6177ce4688
commit
e4016823d7
@ -49,5 +49,5 @@
|
|||||||
// "postCreateCommand": "apt-get update && apt-get install -y 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.
|
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
|
||||||
"remoteUser": "acore"
|
"remoteUser": "root"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ insert_final_newline = true
|
|||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
max_line_length = 80
|
max_line_length = 80
|
||||||
|
|
||||||
[*.{json,ts,js}]
|
[*.{json,ts,js,yml}]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|||||||
1
.github/workflows/build_dbimport.yml
vendored
1
.github/workflows/build_dbimport.yml
vendored
@ -21,6 +21,7 @@ jobs:
|
|||||||
name: ${{ matrix.compiler }}
|
name: ${{ matrix.compiler }}
|
||||||
env:
|
env:
|
||||||
COMPILER: ${{ matrix.compiler }}
|
COMPILER: ${{ matrix.compiler }}
|
||||||
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Cache
|
- name: Cache
|
||||||
|
|||||||
2
.github/workflows/core_build.yml
vendored
2
.github/workflows/core_build.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
||||||
env:
|
env:
|
||||||
COMPILER: ${{ matrix.compiler }}
|
COMPILER: ${{ matrix.compiler }}
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Cache
|
- name: Cache
|
||||||
|
|||||||
11
.github/workflows/core_matrix_build.yml
vendored
11
.github/workflows/core_matrix_build.yml
vendored
@ -29,7 +29,16 @@ jobs:
|
|||||||
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
||||||
env:
|
env:
|
||||||
COMPILER: ${{ matrix.compiler }}
|
COMPILER: ${{ matrix.compiler }}
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'file-cpp') || github.event.label.name == 'file-cpp' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
if: |
|
||||||
|
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
|
&& !github.event.pull_request.draft
|
||||||
|
&& (
|
||||||
|
github.ref == 'refs/heads/master'
|
||||||
|
|| contains(github.event.pull_request.labels.*.name, 'file-cpp'
|
||||||
|
|| github.event.label.name == 'file-cpp'
|
||||||
|
|| contains(github.event.pull_request.labels.*.name, 'run-build')
|
||||||
|
|| github.event.label.name == 'run-build')
|
||||||
|
)
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Cache
|
- name: Cache
|
||||||
|
|||||||
11
.github/workflows/core_modules_build.yml
vendored
11
.github/workflows/core_modules_build.yml
vendored
@ -23,7 +23,16 @@ jobs:
|
|||||||
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.modules }}-modules
|
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.modules }}-modules
|
||||||
env:
|
env:
|
||||||
COMPILER: ${{ matrix.compiler }}
|
COMPILER: ${{ matrix.compiler }}
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'file-cpp') || github.event.label.name == 'file-cpp' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
if: |
|
||||||
|
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
|
&& !github.event.pull_request.draft
|
||||||
|
&& (
|
||||||
|
github.ref == 'refs/heads/master'
|
||||||
|
|| contains(github.event.pull_request.labels.*.name, 'file-cpp'
|
||||||
|
|| github.event.label.name == 'file-cpp'
|
||||||
|
|| contains(github.event.pull_request.labels.*.name, 'run-build')
|
||||||
|
|| github.event.label.name == 'run-build')
|
||||||
|
)
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Checkout modules
|
- name: Checkout modules
|
||||||
|
|||||||
87
.github/workflows/docker_build.yml
vendored
87
.github/workflows/docker_build.yml
vendored
@ -11,13 +11,16 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-build-n-deploy:
|
docker-build-n-deploy-dev:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-20.04]
|
os: [ubuntu-20.04]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
if: |
|
||||||
|
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
|
&& !github.event.pull_request.draft
|
||||||
|
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||||
env:
|
env:
|
||||||
COMPOSE_DOCKER_CLI_BUILD: 1
|
COMPOSE_DOCKER_CLI_BUILD: 1
|
||||||
DOCKER_BUILDKIT: 1
|
DOCKER_BUILDKIT: 1
|
||||||
@ -40,14 +43,6 @@ jobs:
|
|||||||
docker --version
|
docker --version
|
||||||
docker compose --version
|
docker compose --version
|
||||||
|
|
||||||
# TODO: make it work
|
|
||||||
# - uses: whoan/docker-build-with-cache-action@v5
|
|
||||||
# with:
|
|
||||||
# image_tag: master
|
|
||||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
# compose_file: docker-compose.yml
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||||
uses: docker/login-action@v1
|
uses: docker/login-action@v1
|
||||||
@ -55,19 +50,17 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
||||||
# before cache
|
|
||||||
# needed to avoid ccache injected into these images
|
|
||||||
- name: Build Dev
|
- name: Build Dev
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
env:
|
env:
|
||||||
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
|
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
|
||||||
DOCKER_EXTENDS_BIND: abstract-no-bind
|
|
||||||
DOCKER_CLIENT_TIMEOUT: 400
|
DOCKER_CLIENT_TIMEOUT: 400
|
||||||
COMPOSE_HTTP_TIMEOUT: 400
|
COMPOSE_HTTP_TIMEOUT: 400
|
||||||
run: |
|
run: |
|
||||||
export DOCKER_USER_ID=$(id -u)
|
export DOCKER_USER_ID=$(id -u)
|
||||||
export DOCKER_GROUP_ID=$(id -u)
|
export DOCKER_GROUP_ID=$(id -u)
|
||||||
|
# pull the images first to load the docker cache layers
|
||||||
|
./acore.sh docker pull
|
||||||
./acore.sh docker build
|
./acore.sh docker build
|
||||||
|
|
||||||
- name: Deploy Dev
|
- name: Deploy Dev
|
||||||
@ -76,6 +69,47 @@ jobs:
|
|||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||||
run: |
|
run: |
|
||||||
docker compose --profile dev --profile local push
|
docker compose --profile dev --profile local push
|
||||||
|
output=$(./acore.sh version | grep "AzerothCore Rev.") && version=${output#"AzerothCore Rev."}
|
||||||
|
DOCKER_IMAGE_TAG=$version docker compose --profile local push
|
||||||
|
|
||||||
|
docker-build-n-deploy-prod:
|
||||||
|
strategy:
|
||||||
|
fail-fast: true
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-20.04]
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
if: |
|
||||||
|
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
|
&& !github.event.pull_request.draft
|
||||||
|
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||||
|
env:
|
||||||
|
COMPOSE_DOCKER_CLI_BUILD: 1
|
||||||
|
DOCKER_BUILDKIT: 1
|
||||||
|
BUILDKIT_INLINE_CACHE: 1
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Extract branch name
|
||||||
|
shell: bash
|
||||||
|
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
|
||||||
|
id: extract_branch
|
||||||
|
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
sudo rm -rf /usr/local/lib/android
|
||||||
|
sudo rm -rf /usr/share/dotnet
|
||||||
|
sudo rm -rf /opt/ghc
|
||||||
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
||||||
|
docker --version
|
||||||
|
docker compose --version
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Cache
|
- name: Cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
@ -90,16 +124,17 @@ jobs:
|
|||||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
env:
|
env:
|
||||||
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
|
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
|
||||||
DOCKER_EXTENDS_BIND: abstract-no-bind
|
|
||||||
DOCKER_AC_BUILD_TARGET: build
|
|
||||||
DOCKER_CLIENT_TIMEOUT: 220
|
DOCKER_CLIENT_TIMEOUT: 220
|
||||||
COMPOSE_HTTP_TIMEOUT: 220
|
COMPOSE_HTTP_TIMEOUT: 220
|
||||||
run: |
|
run: |
|
||||||
export DOCKER_USER_ID=$(id -u)
|
export DOCKER_USER_ID=$(id -u)
|
||||||
export DOCKER_GROUP_ID=$(id -u)
|
export DOCKER_GROUP_ID=$(id -u)
|
||||||
|
# pull the images first to load the docker cache layers
|
||||||
|
./acore.sh docker prod:pull
|
||||||
./acore.sh docker prod:build
|
./acore.sh docker prod:build
|
||||||
docker compose run --no-deps --name build ac-build echo "image created"
|
# create the container to allow the copy right after
|
||||||
docker cp build:/azerothcore/var/ccache var/docker/
|
docker compose create ac-build-prod
|
||||||
|
docker compose cp ac-build-prod:/azerothcore/var/ccache var/docker/
|
||||||
echo "ccache exported"
|
echo "ccache exported"
|
||||||
|
|
||||||
- name: Deploy Production images
|
- name: Deploy Production images
|
||||||
@ -108,3 +143,19 @@ jobs:
|
|||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||||
run: |
|
run: |
|
||||||
docker compose --profile prod push
|
docker compose --profile prod push
|
||||||
|
output=$(./acore.sh version | grep "AzerothCore Rev.") && version=${output#"AzerothCore Rev."}
|
||||||
|
DOCKER_IMAGE_TAG=$version docker compose --profile prod push
|
||||||
|
|
||||||
|
|
||||||
|
dispatch-acore-docker:
|
||||||
|
needs: [ docker-build-n-deploy-prod , docker-build-n-deploy-dev]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Repository Dispatch
|
||||||
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
|
||||||
|
uses: peter-evans/repository-dispatch@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.ACORE_DOCKER_REPO_ACCESS_TOKEN }}
|
||||||
|
repository: azerothcore/acore-docker
|
||||||
|
# event-type: my-event
|
||||||
|
client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
|
||||||
|
|||||||
2
.github/workflows/import_pending.yml
vendored
2
.github/workflows/import_pending.yml
vendored
@ -9,7 +9,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/issue-labeler.yml
vendored
2
.github/workflows/issue-labeler.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
issue_labeler:
|
issue_labeler:
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
name: Issue Labeler
|
name: Issue Labeler
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
5
.github/workflows/macos_build.yml
vendored
5
.github/workflows/macos_build.yml
vendored
@ -20,7 +20,10 @@ jobs:
|
|||||||
- macos-12
|
- macos-12
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
name: ${{ matrix.os }}
|
name: ${{ matrix.os }}
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
if: |
|
||||||
|
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
|
&& !github.event.pull_request.draft
|
||||||
|
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Cache
|
- name: Cache
|
||||||
|
|||||||
2
.github/workflows/tools_build.yml
vendored
2
.github/workflows/tools_build.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
name: ${{ matrix.os }}-${{ matrix.compiler }}
|
||||||
env:
|
env:
|
||||||
COMPILER: ${{ matrix.compiler }}
|
COMPILER: ${{ matrix.compiler }}
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk'
|
if: github.repository == 'azerothcore/azerothcore-wotlk' && !github.event.pull_request.draft
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Cache
|
- name: Cache
|
||||||
|
|||||||
5
.github/workflows/windows_build.yml
vendored
5
.github/workflows/windows_build.yml
vendored
@ -20,7 +20,10 @@ jobs:
|
|||||||
name: ${{ matrix.os }}
|
name: ${{ matrix.os }}
|
||||||
env:
|
env:
|
||||||
BOOST_ROOT: C:\local\boost_1_79_0
|
BOOST_ROOT: C:\local\boost_1_79_0
|
||||||
if: github.repository == 'azerothcore/azerothcore-wotlk' && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
if: |
|
||||||
|
github.repository == 'azerothcore/azerothcore-wotlk'
|
||||||
|
&& !github.event.pull_request.draft
|
||||||
|
&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.labels.*.name, 'run-build') || github.event.label.name == 'run-build')
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Configure OS
|
- name: Configure OS
|
||||||
|
|||||||
@ -9,7 +9,7 @@ USER_CONF_PATH=${USER_CONF_PATH:-"$AC_PATH_CONF/config.sh"}
|
|||||||
if [ -f "$USER_CONF_PATH" ]; then
|
if [ -f "$USER_CONF_PATH" ]; then
|
||||||
source "$USER_CONF_PATH" # should overwrite previous
|
source "$USER_CONF_PATH" # should overwrite previous
|
||||||
else
|
else
|
||||||
echo "NOTICE: file <$USER_CONF_PATH> has not been found, you should create and configure it."
|
echo "NOTICE: file <$USER_CONF_PATH> not found, we use default configuration only."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|||||||
@ -14,9 +14,6 @@ CBUILD_TESTING=ON
|
|||||||
CSCRIPTPCH=OFF
|
CSCRIPTPCH=OFF
|
||||||
CCOREPCH=OFF
|
CCOREPCH=OFF
|
||||||
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
|
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
|
||||||
DB_CHARACTERS_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
DB_AUTH_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
DB_WORLD_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
CONFIG_SH
|
CONFIG_SH
|
||||||
|
|
||||||
case $COMPILER in
|
case $COMPILER in
|
||||||
|
|||||||
@ -12,9 +12,6 @@ CTOOLS_BUILD=db-only
|
|||||||
CSCRIPTPCH=OFF
|
CSCRIPTPCH=OFF
|
||||||
CCOREPCH=OFF
|
CCOREPCH=OFF
|
||||||
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
|
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
|
||||||
DB_CHARACTERS_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
DB_AUTH_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
DB_WORLD_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
CONFIG_SH
|
CONFIG_SH
|
||||||
|
|
||||||
case $COMPILER in
|
case $COMPILER in
|
||||||
|
|||||||
@ -14,9 +14,6 @@ CTOOLS=ON
|
|||||||
CSCRIPTPCH=OFF
|
CSCRIPTPCH=OFF
|
||||||
CCOREPCH=OFF
|
CCOREPCH=OFF
|
||||||
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
|
CCUSTOMOPTIONS='-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_FLAGS="-Werror" -DCMAKE_CXX_FLAGS="-Werror"'
|
||||||
DB_CHARACTERS_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
DB_AUTH_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
DB_WORLD_CONF="MYSQL_USER='root'; MYSQL_PASS='root'; MYSQL_HOST='localhost';"
|
|
||||||
CONFIG_SH
|
CONFIG_SH
|
||||||
|
|
||||||
time sudo apt-get update -y
|
time sudo apt-get update -y
|
||||||
|
|||||||
@ -29,6 +29,7 @@ comp_options=(
|
|||||||
"compile: Compile only"
|
"compile: Compile only"
|
||||||
"all: clean, configure and compile"
|
"all: clean, configure and compile"
|
||||||
"ccacheClean: Clean ccache files, normally not needed"
|
"ccacheClean: Clean ccache files, normally not needed"
|
||||||
|
"ccacheShowStats: show ccache statistics"
|
||||||
"quit: Close this menu")
|
"quit: Close this menu")
|
||||||
comp_functions=(
|
comp_functions=(
|
||||||
"comp_build"
|
"comp_build"
|
||||||
@ -37,6 +38,7 @@ comp_functions=(
|
|||||||
"comp_compile"
|
"comp_compile"
|
||||||
"comp_all"
|
"comp_all"
|
||||||
"comp_ccacheClean"
|
"comp_ccacheClean"
|
||||||
|
"comp_ccacheShowStats"
|
||||||
"comp_quit")
|
"comp_quit")
|
||||||
|
|
||||||
PS3='[ Please enter your choice ]: '
|
PS3='[ Please enter your choice ]: '
|
||||||
|
|||||||
@ -17,6 +17,8 @@ function comp_ccacheEnable() {
|
|||||||
export CCACHE_CPP2=${CCACHE_CPP2:-true} # optimization for clang
|
export CCACHE_CPP2=${CCACHE_CPP2:-true} # optimization for clang
|
||||||
export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
|
export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
|
||||||
export CCACHE_COMPRESSLEVEL=${CCACHE_COMPRESSLEVEL:-9}
|
export CCACHE_COMPRESSLEVEL=${CCACHE_COMPRESSLEVEL:-9}
|
||||||
|
export CCACHE_COMPILERCHECK=${CCACHE_COMPILERCHECK:-content}
|
||||||
|
export CCACHE_LOGFILE=${CCACHE_LOGFILE:-"$CCACHE_DIR/cache.debug"}
|
||||||
#export CCACHE_NODIRECT=true
|
#export CCACHE_NODIRECT=true
|
||||||
|
|
||||||
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
export CCUSTOMOPTIONS="$CCUSTOMOPTIONS -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
|
||||||
@ -106,6 +108,8 @@ function comp_compile() {
|
|||||||
|
|
||||||
cd $BUILDPATH
|
cd $BUILDPATH
|
||||||
|
|
||||||
|
comp_ccacheEnable
|
||||||
|
|
||||||
comp_ccacheResetStats
|
comp_ccacheResetStats
|
||||||
|
|
||||||
time cmake --build . --config $CTYPE -j $MTHREADS
|
time cmake --build . --config $CTYPE -j $MTHREADS
|
||||||
|
|||||||
@ -45,7 +45,11 @@ RUN addgroup --gid $GROUP_ID acore && \
|
|||||||
|
|
||||||
# must be created to set the correct permissions on them
|
# must be created to set the correct permissions on them
|
||||||
RUN mkdir -p /azerothcore/env/dist/bin
|
RUN mkdir -p /azerothcore/env/dist/bin
|
||||||
RUN mkdir -p /azerothcore/env/dist/data
|
RUN mkdir -p /azerothcore/env/dist/data/Cameras
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/dbc
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/maps
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/mmaps
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/vmaps
|
||||||
RUN mkdir -p /azerothcore/env/dist/logs
|
RUN mkdir -p /azerothcore/env/dist/logs
|
||||||
RUN mkdir -p /azerothcore/env/dist/temp
|
RUN mkdir -p /azerothcore/env/dist/temp
|
||||||
RUN mkdir -p /azerothcore/env/dist/etc
|
RUN mkdir -p /azerothcore/env/dist/etc
|
||||||
@ -59,10 +63,14 @@ RUN chown -R $DOCKER_USER:$DOCKER_USER /azerothcore
|
|||||||
|
|
||||||
USER $DOCKER_USER
|
USER $DOCKER_USER
|
||||||
|
|
||||||
# copy everything so we can work directly within the container
|
# copy only necessary files for the acore dashboard
|
||||||
# using tools such as vscode dev-container
|
COPY --chown=$DOCKER_USER:$DOCKER_USER apps /azerothcore/apps
|
||||||
# NOTE: this folder is different by the /azerothcore (which is binded instead)
|
COPY --chown=$DOCKER_USER:$DOCKER_USER bin /azerothcore/bin
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER . /azerothcore
|
COPY --chown=$DOCKER_USER:$DOCKER_USER conf /azerothcore/conf
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER data /azerothcore/data
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER deps /azerothcore/deps
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.json /azerothcore/acore.json
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.sh /azerothcore/acore.sh
|
||||||
|
|
||||||
# Download deno and make sure the dashboard works
|
# Download deno and make sure the dashboard works
|
||||||
RUN bash /azerothcore/acore.sh quit
|
RUN bash /azerothcore/acore.sh quit
|
||||||
@ -79,6 +87,13 @@ FROM base as dev
|
|||||||
|
|
||||||
LABEL description="AC dev image for dev containers"
|
LABEL description="AC dev image for dev containers"
|
||||||
|
|
||||||
|
USER $DOCKER_USER
|
||||||
|
|
||||||
|
# copy everything so we can work directly within the container
|
||||||
|
# using tools such as vscode dev-container
|
||||||
|
# NOTE: this folder is different by the /azerothcore (which is binded instead)
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER . /azerothcore
|
||||||
|
|
||||||
#================================================================
|
#================================================================
|
||||||
#
|
#
|
||||||
# SERVICE BASE: prepare the OS for the production-ready services
|
# SERVICE BASE: prepare the OS for the production-ready services
|
||||||
@ -115,26 +130,21 @@ RUN apt-get update && apt-get install -y dos2unix gdb gdbserver google-perftools
|
|||||||
# change timezone in container
|
# change timezone in container
|
||||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
|
||||||
|
|
||||||
# copy the sources from the host machine
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER apps /azerothcore/apps
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER bin /azerothcore/bin
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER conf /azerothcore/conf
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER data /azerothcore/data
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER deps /azerothcore/deps
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.json /azerothcore/acore.json
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER acore.sh /azerothcore/acore.sh
|
|
||||||
|
|
||||||
# Correct permissions for non-root operations
|
# Correct permissions for non-root operations
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /home/acore
|
RUN chown -R $DOCKER_USER:$DOCKER_USER /home/acore
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /run
|
RUN chown -R $DOCKER_USER:$DOCKER_USER /run
|
||||||
RUN chown -R $DOCKER_USER:$DOCKER_USER /opt
|
RUN chown -R $DOCKER_USER:$DOCKER_USER /opt
|
||||||
|
|
||||||
RUN chown $DOCKER_USER:$DOCKER_USER /azerothcore
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=base /azerothcore /azerothcore
|
||||||
|
|
||||||
USER $DOCKER_USER
|
USER $DOCKER_USER
|
||||||
|
|
||||||
# must be created to avoid permissions errors
|
# must be created to avoid permissions errors
|
||||||
RUN mkdir -p /azerothcore/env/dist/data
|
RUN mkdir -p /azerothcore/env/dist/data/Cameras
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/dbc
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/maps
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/mmaps
|
||||||
|
RUN mkdir -p /azerothcore/env/dist/data/vmaps
|
||||||
RUN mkdir -p /azerothcore/env/dist/logs
|
RUN mkdir -p /azerothcore/env/dist/logs
|
||||||
RUN mkdir -p /azerothcore/env/dist/etc
|
RUN mkdir -p /azerothcore/env/dist/etc
|
||||||
RUN mkdir -p /azerothcore/env/dist/bin
|
RUN mkdir -p /azerothcore/env/dist/bin
|
||||||
@ -157,12 +167,16 @@ LABEL description="AC authserver image for local environment"
|
|||||||
|
|
||||||
CMD ./acore.sh run-authserver
|
CMD ./acore.sh run-authserver
|
||||||
|
|
||||||
|
USER $DOCKER_USER
|
||||||
|
|
||||||
FROM servicebase as worldserver-local
|
FROM servicebase as worldserver-local
|
||||||
|
|
||||||
LABEL description="AC worldserver image for local environment"
|
LABEL description="AC worldserver image for local environment"
|
||||||
|
|
||||||
CMD ./acore.sh run-worldserver
|
CMD ./acore.sh run-worldserver
|
||||||
|
|
||||||
|
USER $DOCKER_USER
|
||||||
|
|
||||||
#================================================================
|
#================================================================
|
||||||
#
|
#
|
||||||
# BUILD: compile sources
|
# BUILD: compile sources
|
||||||
@ -171,12 +185,20 @@ CMD ./acore.sh run-worldserver
|
|||||||
FROM base as build
|
FROM base as build
|
||||||
|
|
||||||
ARG DOCKER_USER=acore
|
ARG DOCKER_USER=acore
|
||||||
|
USER $DOCKER_USER
|
||||||
|
|
||||||
LABEL description="AC Image used by the build stage to generate production images"
|
LABEL description="AC Image used by the build stage to generate production images"
|
||||||
|
|
||||||
RUN mkdir -p /azerothcore/env/etc/
|
RUN mkdir -p /azerothcore/env/etc/
|
||||||
|
|
||||||
|
# .git is needed by the compiler
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER ./.git /azerothcore/.git
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER ./CMakeLists.txt /azerothcore/CMakeLists.txt
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER ./deps /azerothcore/deps
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER ./src /azerothcore/src
|
||||||
|
COPY --chown=$DOCKER_USER:$DOCKER_USER ./modules /azerothcore/modules
|
||||||
# check if we have ccache files available outside
|
# check if we have ccache files available outside
|
||||||
|
RUN rm -rf /azerothcore/var/ccache/*
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER var/docker/ccache /azerothcore/var/ccache
|
COPY --chown=$DOCKER_USER:$DOCKER_USER var/docker/ccache /azerothcore/var/ccache
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER env/docker/etc/authserver.conf.dockerdist /azerothcore/env/dist/etc/authserver.conf.dockerdist
|
COPY --chown=$DOCKER_USER:$DOCKER_USER env/docker/etc/authserver.conf.dockerdist /azerothcore/env/dist/etc/authserver.conf.dockerdist
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER env/docker/etc/worldserver.conf.dockerdist /azerothcore/env/dist/etc/worldserver.conf.dockerdist
|
COPY --chown=$DOCKER_USER:$DOCKER_USER env/docker/etc/worldserver.conf.dockerdist /azerothcore/env/dist/etc/worldserver.conf.dockerdist
|
||||||
@ -207,6 +229,7 @@ FROM authserver-local as authserver
|
|||||||
LABEL description="AC Production: authserver"
|
LABEL description="AC Production: authserver"
|
||||||
|
|
||||||
ARG DOCKER_USER=acore
|
ARG DOCKER_USER=acore
|
||||||
|
USER $DOCKER_USER
|
||||||
|
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/etc /azerothcore/env/dist/etc
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/etc /azerothcore/env/dist/etc
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/authserver /azerothcore/env/dist/bin/authserver
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/authserver /azerothcore/env/dist/bin/authserver
|
||||||
@ -222,6 +245,7 @@ FROM worldserver-local as worldserver
|
|||||||
LABEL description="AC Production: worldserver"
|
LABEL description="AC Production: worldserver"
|
||||||
|
|
||||||
ARG DOCKER_USER=acore
|
ARG DOCKER_USER=acore
|
||||||
|
USER $DOCKER_USER
|
||||||
|
|
||||||
RUN mkdir -p /azerothcore/env/dist/bin/lua_scripts
|
RUN mkdir -p /azerothcore/env/dist/bin/lua_scripts
|
||||||
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/etc /azerothcore/env/dist/etc
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/etc /azerothcore/env/dist/etc
|
||||||
@ -258,9 +282,8 @@ RUN addgroup --gid $GROUP_ID acore && \
|
|||||||
ENV DATAPATH=/azerothcore/env/dist/data
|
ENV DATAPATH=/azerothcore/env/dist/data
|
||||||
ENV DATAPATH_ZIP=/tmp/data.zip
|
ENV DATAPATH_ZIP=/tmp/data.zip
|
||||||
|
|
||||||
RUN --mount=type=bind,target=/azerothcore-temp,readwrite /azerothcore-temp/acore.sh client-data && chown -R $DOCKER_USER:$DOCKER_USER /azerothcore
|
RUN mkdir -p "$DATAPATH"
|
||||||
|
RUN --mount=type=bind,target=/azerothcore-temp,readwrite --mount=type=cache,target=/azerothcore/env/dist/data /azerothcore-temp/acore.sh client-data && chown -R $DOCKER_USER:$DOCKER_USER /azerothcore
|
||||||
RUN apt-get remove --purge -y tzdata curl unzip && apt-get autoremove -y
|
|
||||||
|
|
||||||
USER $DOCKER_USER
|
USER $DOCKER_USER
|
||||||
|
|
||||||
@ -302,14 +325,14 @@ USER $DOCKER_USER
|
|||||||
|
|
||||||
WORKDIR /azerothcore/env/client/
|
WORKDIR /azerothcore/env/client/
|
||||||
|
|
||||||
|
RUN mkdir -p /azerothcore/env/client/Cameras
|
||||||
RUN mkdir -p /azerothcore/env/client/dbc
|
RUN mkdir -p /azerothcore/env/client/dbc
|
||||||
RUN mkdir -p /azerothcore/env/client/maps
|
RUN mkdir -p /azerothcore/env/client/maps
|
||||||
RUN mkdir -p /azerothcore/env/client/mmaps
|
RUN mkdir -p /azerothcore/env/client/mmaps
|
||||||
RUN mkdir -p /azerothcore/env/client/vmaps
|
RUN mkdir -p /azerothcore/env/client/vmaps
|
||||||
|
|
||||||
# Need fix
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/map_extractor /azerothcore/env/client/map_extractor
|
||||||
# COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/mapextractor /azerothcore/env/client/mapextractor
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/mmaps_generator /azerothcore/env/client/mmaps_generator
|
||||||
# COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/mmaps_generator /azerothcore/env/client/mmaps_generator
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/vmap4_assembler /azerothcore/env/client/vmap4_assembler
|
||||||
# COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/vmap4assembler /azerothcore/env/client/vmap4assembler
|
COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/vmap4_extractor /azerothcore/env/client/vmap4_extractor
|
||||||
# COPY --chown=$DOCKER_USER:$DOCKER_USER --from=build /azerothcore/env/dist/bin/vmap4extractor /azerothcore/env/client/vmap4extractor
|
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
CUR_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
CTOOLS_BUILD=all
|
||||||
|
|
||||||
# allow the user to override configs
|
# allow the user to override configs
|
||||||
if [ -f "$AC_PATH_CONF/config.sh" ]; then
|
if [ -f "$AC_PATH_CONF/config.sh" ]; then
|
||||||
source "$AC_PATH_CONF/config.sh" # should overwrite previous
|
source "$AC_PATH_CONF/config.sh" # should overwrite previous
|
||||||
|
|||||||
@ -39,9 +39,19 @@ shellCommandFactory(
|
|||||||
"build",
|
"build",
|
||||||
"Build the authserver and worldserver",
|
"Build the authserver and worldserver",
|
||||||
[
|
[
|
||||||
"docker compose --profile local build --parallel",
|
"docker compose --profile local --profile dev --profile dev-build build --parallel",
|
||||||
|
"docker image prune -f",
|
||||||
|
"docker compose run --rm --no-deps ac-dev-build bash apps/docker/docker-build-dev.sh",
|
||||||
|
],
|
||||||
|
env
|
||||||
|
);
|
||||||
|
|
||||||
|
shellCommandFactory(
|
||||||
|
"pull",
|
||||||
|
"Pull build and local images",
|
||||||
|
[
|
||||||
|
"docker compose --profile local --profile dev --profile dev-build pull --parallel",
|
||||||
"docker image prune -f",
|
"docker image prune -f",
|
||||||
"docker compose run --rm ac-build bash apps/docker/docker-build-dev.sh",
|
|
||||||
],
|
],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
@ -50,20 +60,9 @@ shellCommandFactory(
|
|||||||
"build:nocache",
|
"build:nocache",
|
||||||
"Build the authserver and worldserver without docker cache",
|
"Build the authserver and worldserver without docker cache",
|
||||||
[
|
[
|
||||||
"docker compose --profile local build --no-cache --parallel",
|
"docker compose --profile local --profile dev --profile dev-build build --no-cache --parallel",
|
||||||
"docker image prune -f",
|
"docker image prune -f",
|
||||||
"docker compose run --rm ac-build bash apps/docker/docker-build-dev.sh",
|
"docker compose run --rm --no-deps ac-dev-build bash apps/docker/docker-build-dev.sh",
|
||||||
],
|
|
||||||
env
|
|
||||||
);
|
|
||||||
|
|
||||||
shellCommandFactory(
|
|
||||||
"build:compile",
|
|
||||||
"Run the compilation process only, without rebuilding all docker images",
|
|
||||||
[
|
|
||||||
"docker compose build --parallel ac-build",
|
|
||||||
"docker image prune -f",
|
|
||||||
"docker compose run --rm ac-build bash apps/docker/docker-build-dev.sh",
|
|
||||||
],
|
],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
@ -73,7 +72,8 @@ shellCommandFactory(
|
|||||||
"Clean build files",
|
"Clean build files",
|
||||||
[
|
[
|
||||||
"docker image prune -f",
|
"docker image prune -f",
|
||||||
`docker compose run --rm ac-build bash acore.sh compiler clean`,
|
`docker compose run --rm --no-deps ac-dev-server bash acore.sh compiler clean`,
|
||||||
|
`docker compose run --rm --no-deps ac-dev-server bash acore.sh compiler ccacheClean`,
|
||||||
],
|
],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
@ -81,7 +81,7 @@ shellCommandFactory(
|
|||||||
shellCommandFactory(
|
shellCommandFactory(
|
||||||
"client-data",
|
"client-data",
|
||||||
"Download client data inside the ac-data volume",
|
"Download client data inside the ac-data volume",
|
||||||
["docker compose run --rm ac-build bash acore.sh client-data"],
|
["docker compose run --rm --no-deps ac-dev-server bash acore.sh client-data"],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ shellCommandFactory(
|
|||||||
|
|
||||||
shellCommandFactory(
|
shellCommandFactory(
|
||||||
"dev:build",
|
"dev:build",
|
||||||
"Build using the dev server, it uses volumes to compile which can be faster on linux & WSL",
|
"Build using the dev server",
|
||||||
["docker compose run --rm ac-dev-server bash acore.sh compiler build"],
|
["docker compose run --rm ac-dev-server bash acore.sh compiler build"],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
@ -118,28 +118,28 @@ shellCommandFactory(
|
|||||||
|
|
||||||
shellCommandFactory(
|
shellCommandFactory(
|
||||||
"prod:build",
|
"prod:build",
|
||||||
"Build producion services",
|
"[TEST ONLY] Build producion services",
|
||||||
["docker compose --profile prod build --parallel", "docker image prune -f"],
|
["docker compose --profile prod build --parallel", "docker image prune -f"],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
|
|
||||||
shellCommandFactory(
|
shellCommandFactory(
|
||||||
"prod:pull",
|
"prod:pull",
|
||||||
"Pull production services from the remote registry",
|
"[TEST ONLY] Pull production services from the remote registry",
|
||||||
["docker compose --profile prod pull"],
|
["docker compose --profile prod pull"],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
|
|
||||||
shellCommandFactory(
|
shellCommandFactory(
|
||||||
"prod:up",
|
"prod:up",
|
||||||
"Start production services (foreground)",
|
"[TEST ONLY] Start production services (foreground)",
|
||||||
["docker compose --profile prod-app up"],
|
["docker compose --profile prod-app up"],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
|
|
||||||
shellCommandFactory(
|
shellCommandFactory(
|
||||||
"prod:up:d",
|
"prod:up:d",
|
||||||
"Start production services (background)",
|
"[TEST ONLY] Start production services (background)",
|
||||||
["docker compose --profile prod-app up -d"],
|
["docker compose --profile prod-app up -d"],
|
||||||
env
|
env
|
||||||
);
|
);
|
||||||
@ -176,7 +176,7 @@ program
|
|||||||
}
|
}
|
||||||
|
|
||||||
services.pop();
|
services.pop();
|
||||||
services = services.slice(2);
|
services = services.slice(1);
|
||||||
|
|
||||||
res.close(); // Don't forget to close it
|
res.close(); // Don't forget to close it
|
||||||
|
|
||||||
@ -304,8 +304,6 @@ async function checkDockerVersion() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
// Handle it however you like
|
|
||||||
// e.g. display usage
|
|
||||||
while (true) {
|
while (true) {
|
||||||
const version = await checkDockerVersion();
|
const version = await checkDockerVersion();
|
||||||
if (version !== true) {
|
if (version !== true) {
|
||||||
|
|||||||
@ -67,7 +67,11 @@ function _switch() {
|
|||||||
DOCKER=1 denoRunFile "$AC_PATH_APPS/docker/docker-cmd.ts" "${@:2}"
|
DOCKER=1 denoRunFile "$AC_PATH_APPS/docker/docker-cmd.ts" "${@:2}"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
""|"quit"|"14")
|
""|"v"|"version"|"14")
|
||||||
|
denoRunFile "$AC_PATH_APPS/installer/main.ts" "version"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
""|"quit"|"15")
|
||||||
echo "Goodbye!"
|
echo "Goodbye!"
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
|
|||||||
43
apps/installer/main.ts
Normal file
43
apps/installer/main.ts
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { Command } from "https://cdn.deno.land/cmd/versions/v1.2.0/raw/mod.ts";
|
||||||
|
import { getAcoreReleaseVersion } from "./utils.ts";
|
||||||
|
import { Input } from "https://deno.land/x/cliffy@v0.25.2/prompt/mod.ts";
|
||||||
|
|
||||||
|
const program = new Command();
|
||||||
|
|
||||||
|
program
|
||||||
|
.name("acore.sh")
|
||||||
|
.description("Shell scripts for docker")
|
||||||
|
.version("1.0.0");
|
||||||
|
|
||||||
|
// program
|
||||||
|
// .command("quit")
|
||||||
|
// .description("Close docker command")
|
||||||
|
// .action(() => {
|
||||||
|
// process.exit(0);
|
||||||
|
// });
|
||||||
|
|
||||||
|
program
|
||||||
|
.command("version")
|
||||||
|
.description("Get the version of the current AzerothCore revision")
|
||||||
|
.action(async () => {
|
||||||
|
console.log(await getAcoreReleaseVersion());
|
||||||
|
});
|
||||||
|
|
||||||
|
async function main() {
|
||||||
|
let exit = false;
|
||||||
|
do {
|
||||||
|
if (Deno.args.length === 0) {
|
||||||
|
program.outputHelp();
|
||||||
|
const command = await Input.prompt({
|
||||||
|
message: "Enter the command:",
|
||||||
|
});
|
||||||
|
console.log(command);
|
||||||
|
await program.parseAsync(command.split(" "));
|
||||||
|
} else {
|
||||||
|
exit = true;
|
||||||
|
await program.parseAsync(Deno.args);
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
} while (!exit);
|
||||||
|
}
|
||||||
|
main();
|
||||||
17
apps/installer/utils.ts
Normal file
17
apps/installer/utils.ts
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import * as path from "https://deno.land/std/path/mod.ts";
|
||||||
|
import makeloc from "https://deno.land/x/dirname@1.1.2/mod.ts";
|
||||||
|
|
||||||
|
const { __dirname } = makeloc(import.meta);
|
||||||
|
|
||||||
|
// specify the needed paths here
|
||||||
|
const ACORE_JSON = path.resolve(__dirname + "/../../acore.json");
|
||||||
|
|
||||||
|
export async function getAcoreReleaseVersion() {
|
||||||
|
// read the acore.json file to work with the versioning
|
||||||
|
const decoder = new TextDecoder("utf-8");
|
||||||
|
//console.debug(`Open ${ACORE_JSON}`)
|
||||||
|
const data = await Deno.readFile(ACORE_JSON);
|
||||||
|
const acoreInfo = JSON.parse(decoder.decode(data));
|
||||||
|
|
||||||
|
return `AzerothCore Rev. ${acoreInfo.version}`;
|
||||||
|
}
|
||||||
12
conf/dist/env.ac
vendored
12
conf/dist/env.ac
vendored
@ -13,18 +13,6 @@ CTYPE=RelWithDebInfo
|
|||||||
CSCRIPTS=static
|
CSCRIPTS=static
|
||||||
AC_CCACHE=true
|
AC_CCACHE=true
|
||||||
|
|
||||||
#
|
|
||||||
# DATABASE
|
|
||||||
#
|
|
||||||
|
|
||||||
OUTPUT_FOLDER=/azerothcore/var/build/sql/
|
|
||||||
|
|
||||||
DB_AUTH_CONF="MYSQL_USER='root'; MYSQL_PASS='password'; MYSQL_HOST='ac-database'; MYSQL_PORT='3306';"
|
|
||||||
|
|
||||||
DB_CHARACTERS_CONF="MYSQL_USER='root'; MYSQL_PASS='password'; MYSQL_HOST='ac-database'; MYSQL_PORT='3306';"
|
|
||||||
|
|
||||||
DB_WORLD_CONF="MYSQL_USER='root'; MYSQL_PASS='password'; MYSQL_HOST='ac-database'; MYSQL_PORT='3306';"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# SIMPLE RESTARTER
|
# SIMPLE RESTARTER
|
||||||
#
|
#
|
||||||
|
|||||||
14
conf/dist/env.docker
vendored
14
conf/dist/env.docker
vendored
@ -5,10 +5,15 @@
|
|||||||
|
|
||||||
DOCKER_AC_ENV_FILE=
|
DOCKER_AC_ENV_FILE=
|
||||||
|
|
||||||
DOCKER_VOL_DATA=
|
DOCKER_VOL_ROOT=
|
||||||
|
DOCKER_VOL_CONF=
|
||||||
DOCKER_VOL_ETC=
|
DOCKER_VOL_ETC=
|
||||||
DOCKER_VOL_LOGS=
|
DOCKER_VOL_LOGS=
|
||||||
DOCKER_VOL_CONF=
|
DOCKER_VOL_DATA_CAMERAS=
|
||||||
|
DOCKER_VOL_DATA_DBC=
|
||||||
|
DOCKER_VOL_DATA_MAPS=
|
||||||
|
DOCKER_VOL_DATA_VMAPS=
|
||||||
|
DOCKER_VOL_DATA_MMAPS=
|
||||||
|
|
||||||
DOCKER_WORLD_EXTERNAL_PORT=
|
DOCKER_WORLD_EXTERNAL_PORT=
|
||||||
DOCKER_SOAP_EXTERNAL_PORT=
|
DOCKER_SOAP_EXTERNAL_PORT=
|
||||||
@ -20,8 +25,3 @@ DOCKER_USER=
|
|||||||
DOCKER_USER_ID=
|
DOCKER_USER_ID=
|
||||||
DOCKER_GROUP_ID=
|
DOCKER_GROUP_ID=
|
||||||
|
|
||||||
# To maximize the performance on MAC you can change the DOCKER_EXTENDS_BIND variable
|
|
||||||
# to "abstract-no-bind", however it won't bind the host directory inside the container.
|
|
||||||
# It means that you need to work directly within the container using a tool
|
|
||||||
# like the VScode dev-container of the remote-extension suite
|
|
||||||
DOCKER_EXTENDS_BIND=
|
|
||||||
|
|||||||
@ -20,36 +20,17 @@ x-ac-shared-conf: &ac-shared-conf
|
|||||||
working_dir: /azerothcore
|
working_dir: /azerothcore
|
||||||
environment:
|
environment:
|
||||||
AC_DISABLE_INTERACTIVE: "1"
|
AC_DISABLE_INTERACTIVE: "1"
|
||||||
depends_on:
|
|
||||||
ac-database:
|
x-ac-service-conf: &ac-service-conf
|
||||||
condition: service_healthy
|
<<: *ac-shared-conf
|
||||||
|
# List can't be merged. See: https://forums.docker.com/t/how-to-merge-a-list-of-volumes-from-an-extension-field-into-the-service-definition/77454
|
||||||
|
# volumes:
|
||||||
|
# - ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
|
||||||
|
# # [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
|
||||||
|
# - ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
||||||
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
#============================
|
|
||||||
#
|
|
||||||
# Abstract services to extend
|
|
||||||
#
|
|
||||||
#============================
|
|
||||||
|
|
||||||
abstract-bind:
|
|
||||||
image: local/azerothcore/abstract-bind
|
|
||||||
volumes:
|
|
||||||
- .:/azerothcore
|
|
||||||
# expose some dist folder outside allowing the host to use them
|
|
||||||
- ${DOCKER_VOL_CONF:-./conf}:/azerothcore/conf
|
|
||||||
- ${DOCKER_VOL_BIN:-ac-bin}:/azerothcore/env/dist/bin
|
|
||||||
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
|
|
||||||
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
|
|
||||||
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
|
||||||
- ${DOCKER_VOL_DATA:-./env/docker/data}:/azerothcore/env/dist/data:delegated
|
|
||||||
profiles: [abstract-service] # do not run this
|
|
||||||
|
|
||||||
abstract-no-bind:
|
|
||||||
image: local/azerothcore/abstract-no-bind
|
|
||||||
volumes:
|
|
||||||
- ac-proj:/azerothcore
|
|
||||||
profiles: [abstract-service] # do not run this
|
|
||||||
|
|
||||||
#=======================
|
#=======================
|
||||||
#
|
#
|
||||||
# DATABASE
|
# DATABASE
|
||||||
@ -77,97 +58,57 @@ services:
|
|||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 40
|
retries: 40
|
||||||
|
|
||||||
#=======================
|
|
||||||
#
|
|
||||||
# APP Services
|
|
||||||
#
|
|
||||||
#=======================
|
|
||||||
|
|
||||||
ac-worldserver:
|
|
||||||
<<: *ac-shared-conf
|
|
||||||
extends: ${DOCKER_EXTENDS_BIND:-abstract-bind}
|
|
||||||
stdin_open: true
|
|
||||||
tty: true
|
|
||||||
command: ./acore.sh run-worldserver
|
|
||||||
image: acore/ac-wotlk-worldserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
|
||||||
restart: unless-stopped
|
|
||||||
env_file:
|
|
||||||
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
|
||||||
user: ${DOCKER_USER:-acore}
|
|
||||||
privileged: true
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
target: worldserver-local
|
|
||||||
dockerfile: ./apps/docker/Dockerfile
|
|
||||||
args:
|
|
||||||
USER_ID: ${DOCKER_USER_ID:-1000}
|
|
||||||
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
|
|
||||||
DOCKER_USER: ${DOCKER_USER:-acore}
|
|
||||||
<<: *cache-from
|
|
||||||
ports:
|
|
||||||
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
|
|
||||||
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
|
||||||
profiles: [local, app, worldserver]
|
|
||||||
|
|
||||||
ac-authserver:
|
|
||||||
<<: *ac-shared-conf
|
|
||||||
extends: ${DOCKER_EXTENDS_BIND:-abstract-bind}
|
|
||||||
tty: true
|
|
||||||
command: ./acore.sh run-authserver
|
|
||||||
image: acore/ac-wotlk-authserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
|
||||||
restart: unless-stopped
|
|
||||||
env_file:
|
|
||||||
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
|
||||||
user: ${DOCKER_USER:-acore}
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
target: authserver-local
|
|
||||||
dockerfile: ./apps/docker/Dockerfile
|
|
||||||
args:
|
|
||||||
USER_ID: ${DOCKER_USER_ID:-1000}
|
|
||||||
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
|
|
||||||
DOCKER_USER: ${DOCKER_USER:-acore}
|
|
||||||
<<: *cache-from
|
|
||||||
ports:
|
|
||||||
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
|
|
||||||
profiles: [local, app, authserver]
|
|
||||||
|
|
||||||
#======================
|
#======================
|
||||||
#
|
#
|
||||||
# Dev services
|
# Dev services
|
||||||
#
|
#
|
||||||
#======================
|
#======================
|
||||||
ac-build:
|
|
||||||
<<: *ac-shared-conf
|
|
||||||
extends: ${DOCKER_EXTENDS_BIND:-abstract-bind}
|
|
||||||
image: acore/ac-wotlk-dev-server:${DOCKER_IMAGE_TAG:-master}
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
target: ${DOCKER_AC_BUILD_TARGET:-dev}
|
|
||||||
dockerfile: ./apps/docker/Dockerfile
|
|
||||||
args:
|
|
||||||
USER_ID: ${DOCKER_USER_ID:-1000}
|
|
||||||
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
|
|
||||||
DOCKER_USER: ${DOCKER_USER:-acore}
|
|
||||||
<<: *cache-from
|
|
||||||
env_file:
|
|
||||||
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
|
||||||
working_dir: /azerothcore/
|
|
||||||
volumes:
|
|
||||||
- ${DOCKER_VOL_BUILD:-ac-build}:/azerothcore/var/build
|
|
||||||
# with this conf you can use an external path for it (useful for CI)
|
|
||||||
- ${DOCKER_VOL_CCACHE:-ac-ccache}:/azerothcore/var/ccache
|
|
||||||
# use internal copied files instead of volumes
|
|
||||||
- /azerothcore/src
|
|
||||||
- /azerothcore/data
|
|
||||||
- /azerothcore/modules
|
|
||||||
profiles: [local, build]
|
|
||||||
|
|
||||||
ac-dev-server:
|
#
|
||||||
<<: *ac-shared-conf
|
# Used for the build process to avoid the host binding of the /azerothcore
|
||||||
extends: ${DOCKER_EXTENDS_BIND:-abstract-bind}
|
# and speedup the compilation by avoiding the host-container filesystem conversion issue
|
||||||
tty: true
|
# on non-ext filesystems. Reference https://stackoverflow.com/a/63437557/1964544
|
||||||
|
#
|
||||||
|
ac-dev-build:
|
||||||
|
<<: [ *ac-shared-conf ] # merge with
|
||||||
image: acore/ac-wotlk-dev-server:${DOCKER_IMAGE_TAG:-master}
|
image: acore/ac-wotlk-dev-server:${DOCKER_IMAGE_TAG:-master}
|
||||||
|
user: ${DOCKER_USER:-root}
|
||||||
|
cap_add:
|
||||||
|
- SYS_NICE # CAP_SYS_NICE
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
target: dev
|
||||||
|
dockerfile: ./apps/docker/Dockerfile
|
||||||
|
args:
|
||||||
|
USER_ID: ${DOCKER_USER_ID:-1000}
|
||||||
|
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
|
||||||
|
DOCKER_USER: ${DOCKER_USER:-acore}
|
||||||
|
<<: *cache-from
|
||||||
|
security_opt:
|
||||||
|
- seccomp:unconfined
|
||||||
|
env_file:
|
||||||
|
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
||||||
|
volumes:
|
||||||
|
# expose some dist folder outside allowing the host to use them
|
||||||
|
- ${DOCKER_VOL_CONF:-./conf}:/azerothcore/conf
|
||||||
|
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin
|
||||||
|
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
|
||||||
|
- ac-build-dev:/azerothcore/var/build
|
||||||
|
- ac-ccache-dev:/azerothcore/var/ccache
|
||||||
|
profiles: [dev-build]
|
||||||
|
|
||||||
|
#
|
||||||
|
# Dev server with the ./azerothcore folder binded from the host
|
||||||
|
# Please use Linux, WSL2 or any ext-compatible filesystem
|
||||||
|
# to avoid performance issues
|
||||||
|
#
|
||||||
|
ac-dev-server:
|
||||||
|
<<: [ *ac-shared-conf ] # merge with
|
||||||
|
tty: true
|
||||||
|
image: acore/ac-wotlk-dev-server:${DOCKER_IMAGE_TAG:-master}
|
||||||
|
user: ${DOCKER_USER:-root}
|
||||||
|
cap_add:
|
||||||
|
- SYS_NICE # CAP_SYS_NICE
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: dev
|
target: dev
|
||||||
@ -181,36 +122,182 @@ services:
|
|||||||
- seccomp:unconfined
|
- seccomp:unconfined
|
||||||
env_file:
|
env_file:
|
||||||
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
||||||
user: ${DOCKER_USER:-acore}
|
|
||||||
environment:
|
|
||||||
DBLIST: AUTH,CHARACTERS,WORLD
|
|
||||||
ports:
|
ports:
|
||||||
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
|
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
|
||||||
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
|
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
|
||||||
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
||||||
volumes:
|
volumes:
|
||||||
|
- ${DOCKER_VOL_ROOT:-.}:/azerothcore:cached
|
||||||
|
# expose some dist folder outside allowing the host to use them
|
||||||
|
- ${DOCKER_VOL_CONF:-./conf}:/azerothcore/conf
|
||||||
|
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin
|
||||||
|
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
|
||||||
|
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
|
||||||
|
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
||||||
- ac-build-dev:/azerothcore/var/build
|
- ac-build-dev:/azerothcore/var/build
|
||||||
- ac-ccache-dev:/azerothcore/var/ccache
|
- ac-ccache-dev:/azerothcore/var/ccache
|
||||||
|
# client data
|
||||||
|
- ${DOCKER_VOL_DATA_CAMERAS:-./env/docker/data/Cameras}:/azerothcore/env/dist/data/Cameras
|
||||||
|
- ${DOCKER_VOL_DATA_DBC:-./env/docker/data/dbc}:/azerothcore/env/dist/data/dbc
|
||||||
|
- ${DOCKER_VOL_DATA_MAPS:-./env/docker/data/maps}:/azerothcore/env/dist/data/maps
|
||||||
|
- ${DOCKER_VOL_DATA_VMAPS:-./env/docker/data/vmaps}:/azerothcore/env/dist/data/vmaps
|
||||||
|
- ${DOCKER_VOL_DATA_MMAPS:-./env/docker/data/mmaps}:/azerothcore/env/dist/data/mmaps
|
||||||
|
# remount again for the extractors
|
||||||
|
- ${DOCKER_VOL_DATA_CAMERAS:-./env/docker/data/Cameras}:/azerothcore/env/dist/bin/Cameras
|
||||||
|
- ${DOCKER_VOL_DATA_DBC:-./env/docker/data/dbc}:/azerothcore/env/dist/bin/dbc
|
||||||
|
- ${DOCKER_VOL_DATA_MAPS:-./env/docker/data/maps}:/azerothcore/env/dist/bin/maps
|
||||||
|
- ${DOCKER_VOL_DATA_VMAPS:-./env/docker/data/vmaps}:/azerothcore/env/dist/bin/vmaps
|
||||||
|
- ${DOCKER_VOL_DATA_MMAPS:-./env/docker/data/mmaps}:/azerothcore/env/dist/bin/mmaps
|
||||||
# this is not the directory of the extracted data! It's the client folder used by the extractors
|
# this is not the directory of the extracted data! It's the client folder used by the extractors
|
||||||
- ${DOCKER_CLIENT_DATA_FOLDER:-./var/client}:/azerothcore/env/dist/bin/Data
|
- ${DOCKER_AC_CLIENT_FOLDER:-./var/client}:/azerothcore/env/dist/bin/Data
|
||||||
profiles: [dev]
|
profiles: [dev]
|
||||||
|
depends_on:
|
||||||
|
ac-database:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
ac-db-import:
|
||||||
|
<<: *ac-shared-conf
|
||||||
|
image: acore/ac-wotlk-worldserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
|
command: ./env/dist/bin/dbimport
|
||||||
|
volumes:
|
||||||
|
# read-only binaries compiled by ac-dev-server
|
||||||
|
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin:ro
|
||||||
|
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
|
||||||
|
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
|
||||||
|
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
||||||
|
profiles: [local, app, db-import-local]
|
||||||
|
depends_on:
|
||||||
|
ac-database:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
#=======================
|
||||||
|
#
|
||||||
|
# APP Services
|
||||||
|
#
|
||||||
|
#=======================
|
||||||
|
|
||||||
|
ac-worldserver:
|
||||||
|
<<: *ac-service-conf # merge with ac-service-conf
|
||||||
|
stdin_open: true
|
||||||
|
tty: true
|
||||||
|
cap_add:
|
||||||
|
- SYS_NICE # CAP_SYS_NICE
|
||||||
|
command: ./acore.sh run-worldserver
|
||||||
|
image: acore/ac-wotlk-worldserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
||||||
|
user: ${DOCKER_USER:-root}
|
||||||
|
privileged: true
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
target: worldserver-local
|
||||||
|
dockerfile: ./apps/docker/Dockerfile
|
||||||
|
args:
|
||||||
|
USER_ID: ${DOCKER_USER_ID:-1000}
|
||||||
|
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
|
||||||
|
DOCKER_USER: ${DOCKER_USER:-acore}
|
||||||
|
<<: *cache-from
|
||||||
|
ports:
|
||||||
|
- ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085
|
||||||
|
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
||||||
|
volumes:
|
||||||
|
# read-only binaries compiled by ac-dev-server
|
||||||
|
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin:ro
|
||||||
|
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
|
||||||
|
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
|
||||||
|
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
||||||
|
# client data
|
||||||
|
- ${DOCKER_VOL_DATA_CAMERAS:-./env/docker/data/Cameras}:/azerothcore/env/dist/data/Cameras
|
||||||
|
- ${DOCKER_VOL_DATA_DBC:-./env/docker/data/dbc}:/azerothcore/env/dist/data/dbc
|
||||||
|
- ${DOCKER_VOL_DATA_MAPS:-./env/docker/data/maps}:/azerothcore/env/dist/data/maps
|
||||||
|
- ${DOCKER_VOL_DATA_VMAPS:-./env/docker/data/vmaps}:/azerothcore/env/dist/data/vmaps
|
||||||
|
- ${DOCKER_VOL_DATA_MMAPS:-./env/docker/data/mmaps}:/azerothcore/env/dist/data/mmaps
|
||||||
|
profiles: [local, app, worldserver]
|
||||||
|
depends_on:
|
||||||
|
ac-database:
|
||||||
|
condition: service_healthy
|
||||||
|
ac-db-import:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
|
||||||
|
ac-authserver:
|
||||||
|
<<: *ac-service-conf # merge with ac-service-conf
|
||||||
|
tty: true
|
||||||
|
command: ./acore.sh run-authserver
|
||||||
|
image: acore/ac-wotlk-authserver-local:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
|
restart: unless-stopped
|
||||||
|
env_file:
|
||||||
|
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
||||||
|
user: ${DOCKER_USER:-root}
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
target: authserver-local
|
||||||
|
dockerfile: ./apps/docker/Dockerfile
|
||||||
|
args:
|
||||||
|
USER_ID: ${DOCKER_USER_ID:-1000}
|
||||||
|
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
|
||||||
|
DOCKER_USER: ${DOCKER_USER:-acore}
|
||||||
|
<<: *cache-from
|
||||||
|
volumes:
|
||||||
|
# read-only binaries compiled by ac-dev-server
|
||||||
|
- ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin:ro
|
||||||
|
- ${DOCKER_VOL_ETC:-./env/docker/etc}:/azerothcore/env/dist/etc
|
||||||
|
# [osxfs optimization]: https://stackoverflow.com/a/63437557/1964544
|
||||||
|
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
||||||
|
ports:
|
||||||
|
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
|
||||||
|
profiles: [local, app, authserver]
|
||||||
|
depends_on:
|
||||||
|
ac-database:
|
||||||
|
condition: service_healthy
|
||||||
|
ac-db-import:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
|
||||||
#======================
|
#======================
|
||||||
#
|
#
|
||||||
# Production services
|
# Production services
|
||||||
#
|
#
|
||||||
|
# The following services are used to test the production images
|
||||||
|
# Do not use them unless you know what you're doing!
|
||||||
|
# We do not offer support for them
|
||||||
|
#
|
||||||
|
# For a production-ready docker-compose, please check the official repo: https://github.com/azerothcore/acore-docker
|
||||||
|
#
|
||||||
#======================
|
#======================
|
||||||
|
|
||||||
|
ac-database-prod:
|
||||||
|
<<: *networks
|
||||||
|
image: mysql:8.0
|
||||||
|
restart: unless-stopped
|
||||||
|
cap_add:
|
||||||
|
- SYS_NICE # CAP_SYS_NICE
|
||||||
|
ports:
|
||||||
|
- ${DOCKER_DB_EXTERNAL_PORT:-3306}:3306
|
||||||
|
environment:
|
||||||
|
- MYSQL_ROOT_PASSWORD=${DOCKER_DB_ROOT_PASSWORD:-password}
|
||||||
|
volumes:
|
||||||
|
- type: volume
|
||||||
|
source: ac-database-prod
|
||||||
|
target: /var/lib/mysql
|
||||||
|
healthcheck:
|
||||||
|
test: "/usr/bin/mysql --user=root --password=$$MYSQL_ROOT_PASSWORD --execute \"SHOW DATABASES;\""
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 40
|
||||||
|
profiles: [prod]
|
||||||
|
|
||||||
ac-worldserver-prod:
|
ac-worldserver-prod:
|
||||||
<<: *ac-shared-conf
|
<<: *ac-service-conf # merge with ac-service-conf
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
tty: true
|
tty: true
|
||||||
|
cap_add:
|
||||||
|
- SYS_NICE # CAP_SYS_NICE
|
||||||
command: ./acore.sh run-worldserver
|
command: ./acore.sh run-worldserver
|
||||||
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
||||||
user: ${DOCKER_USER:-acore}
|
user: ${DOCKER_USER:-root}
|
||||||
privileged: true
|
privileged: true
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
@ -226,21 +313,25 @@ services:
|
|||||||
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
- ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878
|
||||||
volumes:
|
volumes:
|
||||||
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
- ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated
|
||||||
volumes_from:
|
- ${DOCKER_VOL_CLIENT_DATA_PROD:-ac-client-data-prod}:/azerothcore/env/dist/data:ro
|
||||||
- ac-client-data-server:ro
|
|
||||||
depends_on:
|
|
||||||
- ac-client-data-server
|
|
||||||
profiles: [prod, prod-app, prod-worldserver]
|
profiles: [prod, prod-app, prod-worldserver]
|
||||||
|
depends_on:
|
||||||
|
ac-database-prod:
|
||||||
|
condition: service_healthy
|
||||||
|
ac-db-import-prod:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
ac-client-data-init:
|
||||||
|
condition: service_started
|
||||||
|
|
||||||
ac-authserver-prod:
|
ac-authserver-prod:
|
||||||
<<: *ac-shared-conf
|
<<: *ac-service-conf # merge with ac-service-conf
|
||||||
tty: true
|
tty: true
|
||||||
command: ./acore.sh run-authserver
|
command: ./acore.sh run-authserver
|
||||||
image: acore/ac-wotlk-authserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
image: acore/ac-wotlk-authserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
||||||
user: ${DOCKER_USER:-acore}
|
user: ${DOCKER_USER:-root}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: authserver
|
target: authserver
|
||||||
@ -255,10 +346,16 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
|
- ${DOCKER_AUTH_EXTERNAL_PORT:-3724}:3724
|
||||||
profiles: [prod, prod-app, prod-authserver]
|
profiles: [prod, prod-app, prod-authserver]
|
||||||
|
depends_on:
|
||||||
|
ac-database-prod:
|
||||||
|
condition: service_healthy
|
||||||
|
ac-db-import-prod:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
|
||||||
ac-client-data-server:
|
|
||||||
|
ac-client-data-init:
|
||||||
image: acore/ac-wotlk-client-data:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
image: acore/ac-wotlk-client-data:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
user: ${DOCKER_USER:-acore}
|
user: ${DOCKER_USER:-root}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: client-data
|
target: client-data
|
||||||
@ -269,12 +366,12 @@ services:
|
|||||||
DOCKER_USER: ${DOCKER_USER:-acore}
|
DOCKER_USER: ${DOCKER_USER:-acore}
|
||||||
<<: *cache-from
|
<<: *cache-from
|
||||||
volumes:
|
volumes:
|
||||||
- /azerothcore/env/dist/data
|
- ${DOCKER_VOL_CLIENT_DATA_PROD:-ac-client-data-prod}:/azerothcore/env/dist/data:ro
|
||||||
profiles: [prod, prod-app, clientdata]
|
profiles: [prod, prod-app, clientdata]
|
||||||
|
|
||||||
ac-tools:
|
ac-tools:
|
||||||
image: acore/ac-wotlk-tools:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
image: acore/ac-wotlk-tools:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
user: ${DOCKER_USER:-acore}
|
user: ${DOCKER_USER:-root}
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: tools
|
target: tools
|
||||||
@ -286,34 +383,54 @@ services:
|
|||||||
<<: *cache-from
|
<<: *cache-from
|
||||||
working_dir: /azerothcore/env/client/
|
working_dir: /azerothcore/env/client/
|
||||||
volumes:
|
volumes:
|
||||||
- ${DOCKER_CLIENT_DATA_FOLDER:-./var/client}:/azerothcore/env/client/Data
|
# this is not the directory of the extracted data! It's the client folder used by the extractors
|
||||||
- ${DOCKER_VOL_TOOLS_DBC:-./var/extractors/dbc}:/azerothcore/env/client/dbc
|
- ${DOCKER_AC_CLIENT_FOLDER:-./var/client}:/azerothcore/env/dist/bin/Data
|
||||||
- ${DOCKER_VOL_TOOLS_MAPS:-./var/extractors/maps}:/azerothcore/env/client/maps
|
|
||||||
- ${DOCKER_VOL_TOOLS_VMAPS:-./var/extractors/vmaps}:/azerothcore/env/client/vmaps
|
|
||||||
- ${DOCKER_VOL_TOOLS_MMAPS:-./var/extractors/mmaps}:/azerothcore/env/client/mmaps
|
|
||||||
profiles: [prod, tools]
|
profiles: [prod, tools]
|
||||||
|
|
||||||
ac-db-import:
|
ac-db-import-prod:
|
||||||
<<: *ac-shared-conf
|
<<: *ac-shared-conf
|
||||||
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
image: acore/ac-wotlk-worldserver:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally
|
||||||
command: ./env/dist/bin/dbimport
|
command: ./env/dist/bin/dbimport
|
||||||
profiles: [db-import]
|
profiles: [prod, prod-app, db-import-prod]
|
||||||
|
|
||||||
|
#
|
||||||
|
# Only for internal tests
|
||||||
|
#
|
||||||
|
ac-build-prod:
|
||||||
|
<<: *ac-shared-conf
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
target: build
|
||||||
|
dockerfile: ./apps/docker/Dockerfile
|
||||||
|
args:
|
||||||
|
USER_ID: ${DOCKER_USER_ID:-1000}
|
||||||
|
GROUP_ID: ${DOCKER_GROUP_ID:-1000}
|
||||||
|
DOCKER_USER: ${DOCKER_USER:-acore}
|
||||||
|
<<: *cache-from
|
||||||
|
env_file:
|
||||||
|
${DOCKER_AC_ENV_FILE:-conf/dist/env.ac}
|
||||||
|
working_dir: /azerothcore/
|
||||||
|
profiles: [prod-build]
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
ac-database:
|
ac-database:
|
||||||
ac-bin:
|
ac-database-prod:
|
||||||
|
ac-bin-dev:
|
||||||
ac-build-dev:
|
ac-build-dev:
|
||||||
ac-build:
|
|
||||||
ac-ccache-dev:
|
ac-ccache-dev:
|
||||||
ac-ccache:
|
|
||||||
ac-proj:
|
ac-proj:
|
||||||
|
ac-client-data-prod:
|
||||||
# not used, but you can use them by setting
|
# not used, but you can use them by setting
|
||||||
# the DOCKER_VOL_* env variabiles
|
# the DOCKER_VOL_* env variabiles
|
||||||
|
ac-root:
|
||||||
ac-conf:
|
ac-conf:
|
||||||
ac-etc:
|
ac-etc:
|
||||||
ac-logs:
|
ac-logs:
|
||||||
ac-client-data:
|
ac-client-data-cameras:
|
||||||
ac-client-data-prod:
|
ac-client-data-dbc:
|
||||||
|
ac-client-data-maps:
|
||||||
|
ac-client-data-vmaps:
|
||||||
|
ac-client-data-mmaps:
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
ac-network:
|
ac-network:
|
||||||
|
|||||||
0
env/docker/data/Cameras/.gitkeep
vendored
Normal file
0
env/docker/data/Cameras/.gitkeep
vendored
Normal file
0
env/docker/data/dbc/.gitkeep
vendored
Normal file
0
env/docker/data/dbc/.gitkeep
vendored
Normal file
0
env/docker/data/maps/.gitkeep
vendored
Normal file
0
env/docker/data/maps/.gitkeep
vendored
Normal file
0
env/docker/data/mmaps/.gitkeep
vendored
Normal file
0
env/docker/data/mmaps/.gitkeep
vendored
Normal file
0
env/docker/data/vmaps/.gitkeep
vendored
Normal file
0
env/docker/data/vmaps/.gitkeep
vendored
Normal file
2
env/docker/etc/authserver.conf.dockerdist
vendored
2
env/docker/etc/authserver.conf.dockerdist
vendored
@ -16,7 +16,7 @@ TempDir = "/azerothcore/env/dist/temp"
|
|||||||
LoginDatabaseInfo = "ac-database;3306;root;password;acore_auth"
|
LoginDatabaseInfo = "ac-database;3306;root;password;acore_auth"
|
||||||
|
|
||||||
# Add more configuration overwrites by copying settings from from authserver.conf.dist
|
# Add more configuration overwrites by copying settings from from authserver.conf.dist
|
||||||
LogLevel = 3
|
|
||||||
SQLDriverLogFile = "SQLDriver.log"
|
SQLDriverLogFile = "SQLDriver.log"
|
||||||
SQLDriverQueryLogging = 1
|
SQLDriverQueryLogging = 1
|
||||||
|
|
||||||
|
|||||||
1
env/docker/etc/dbimport.conf.dockerdist
vendored
1
env/docker/etc/dbimport.conf.dockerdist
vendored
@ -13,7 +13,6 @@ WorldDatabaseInfo = "ac-database;3306;root;password;acore_world"
|
|||||||
CharacterDatabaseInfo = "ac-database;3306;root;password;acore_characters"
|
CharacterDatabaseInfo = "ac-database;3306;root;password;acore_characters"
|
||||||
|
|
||||||
# Add more configuration overwrites by copying settings from worldserver.conf.dist
|
# Add more configuration overwrites by copying settings from worldserver.conf.dist
|
||||||
LogLevel = 2
|
|
||||||
|
|
||||||
# Disable idle connections automatic kick since it doesn't work well on macOS + Docker
|
# Disable idle connections automatic kick since it doesn't work well on macOS + Docker
|
||||||
CloseIdleConnections = 0
|
CloseIdleConnections = 0
|
||||||
|
|||||||
1
env/docker/etc/worldserver.conf.dockerdist
vendored
1
env/docker/etc/worldserver.conf.dockerdist
vendored
@ -18,7 +18,6 @@ WorldDatabaseInfo = "ac-database;3306;root;password;acore_world"
|
|||||||
CharacterDatabaseInfo = "ac-database;3306;root;password;acore_characters"
|
CharacterDatabaseInfo = "ac-database;3306;root;password;acore_characters"
|
||||||
|
|
||||||
# Add more configuration overwrites by copying settings from worldserver.conf.dist
|
# Add more configuration overwrites by copying settings from worldserver.conf.dist
|
||||||
LogLevel = 2
|
|
||||||
|
|
||||||
# Disable idle connections automatic kick since it doesn't work well on macOS + Docker
|
# Disable idle connections automatic kick since it doesn't work well on macOS + Docker
|
||||||
CloseIdleConnections = 0
|
CloseIdleConnections = 0
|
||||||
|
|||||||
0
var/extractors/Cameras/.gitkeep
Normal file
0
var/extractors/Cameras/.gitkeep
Normal file
Loading…
x
Reference in New Issue
Block a user