diff options
-rw-r--r-- | .github/workflows/docker_build.yml | 6 | ||||
-rw-r--r-- | docker-compose.yml | 79 |
2 files changed, 24 insertions, 61 deletions
diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index eb6afa0240..c11c067da4 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -43,6 +43,9 @@ jobs: docker --version docker compose --version + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to Docker Hub if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master' uses: docker/login-action@v1 @@ -107,6 +110,9 @@ jobs: docker --version docker compose --version + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Login to Docker Hub if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master' uses: docker/login-action@v1 diff --git a/docker-compose.yml b/docker-compose.yml index e4d4282445..a69a289f83 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,14 @@ x-networks: &networks networks: - ac-network -x-cache-from: &cache-from +x-build-params: &build-params + context: . + dockerfile: ./apps/docker/Dockerfile + args: + USER_ID: ${DOCKER_USER_ID:-1000} + GROUP_ID: ${DOCKER_GROUP_ID:-1000} + DOCKER_USER: ${DOCKER_USER:-acore} + BUILDKIT_INLINE_CACHE: 1 cache_from: - acore/ac-wotlk-authserver:${DOCKER_IMAGE_TAG:-master} - acore/ac-wotlk-authserver-local:${DOCKER_IMAGE_TAG:-master} @@ -76,14 +83,8 @@ services: 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 + <<: *build-params security_opt: - seccomp:unconfined env_file: @@ -110,14 +111,8 @@ services: 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 + <<: *build-params security_opt: - seccomp:unconfined env_file: @@ -190,14 +185,8 @@ services: 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 + <<: *build-params ports: - ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085 - ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878 @@ -230,14 +219,8 @@ services: ${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 + <<: *build-params volumes: # read-only binaries compiled by ac-dev-server - ${DOCKER_VOL_BIN:-ac-bin-dev}:/azerothcore/env/dist/bin:ro @@ -300,14 +283,8 @@ services: user: ${DOCKER_USER:-root} privileged: true build: - context: . target: worldserver - dockerfile: ./apps/docker/Dockerfile - args: - USER_ID: ${DOCKER_USER_ID:-1000} - GROUP_ID: ${DOCKER_GROUP_ID:-1000} - DOCKER_USER: ${DOCKER_USER:-acore} - <<: *cache-from + <<: *build-params ports: - ${DOCKER_WORLD_EXTERNAL_PORT:-8085}:8085 - ${DOCKER_SOAP_EXTERNAL_PORT:-7878}:7878 @@ -333,14 +310,8 @@ services: ${DOCKER_AC_ENV_FILE:-conf/dist/env.ac} user: ${DOCKER_USER:-root} build: - context: . target: authserver - dockerfile: ./apps/docker/Dockerfile - args: - USER_ID: ${DOCKER_USER_ID:-1000} - GROUP_ID: ${DOCKER_GROUP_ID:-1000} - DOCKER_USER: ${DOCKER_USER:-acore} - <<: *cache-from + <<: *build-params volumes: - ${DOCKER_VOL_LOGS:-./env/docker/logs}:/azerothcore/env/dist/logs:delegated ports: @@ -357,15 +328,13 @@ services: image: acore/ac-wotlk-client-data:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally user: ${DOCKER_USER:-root} build: - context: . target: client-data - dockerfile: ./apps/docker/Dockerfile + <<: *build-params args: USER_ID: ${DOCKER_USER_ID:-1000} GROUP_ID: ${DOCKER_GROUP_ID:-1000} DOCKER_USER: ${DOCKER_USER:-acore} - CACHEBUST: ${CACHEBUST:-1} - <<: *cache-from + BUILDKIT_INLINE_CACHE: 1 volumes: - ${DOCKER_VOL_CLIENT_DATA_PROD:-ac-client-data-prod}:/azerothcore/env/dist/data:ro profiles: [prod, prod-app, clientdata] @@ -374,14 +343,8 @@ services: image: acore/ac-wotlk-tools:${DOCKER_IMAGE_TAG:-master} # name of the generated image after built locally user: ${DOCKER_USER:-root} build: - context: . target: tools - dockerfile: ./apps/docker/Dockerfile - args: - USER_ID: ${DOCKER_USER_ID:-1000} - GROUP_ID: ${DOCKER_GROUP_ID:-1000} - DOCKER_USER: ${DOCKER_USER:-acore} - <<: *cache-from + <<: *build-params working_dir: /azerothcore/env/client/ volumes: # this is not the directory of the extracted data! It's the client folder used by the extractors @@ -400,14 +363,8 @@ services: 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 + <<: *build-params env_file: ${DOCKER_AC_ENV_FILE:-conf/dist/env.ac} working_dir: /azerothcore/ |