diff --git a/.github/workflows/ci-master-pr.yml b/.github/workflows/ci-master-pr.yml index bdceed36..0343df24 100644 --- a/.github/workflows/ci-master-pr.yml +++ b/.github/workflows/ci-master-pr.yml @@ -52,7 +52,7 @@ jobs: if: matrix.testenv == 'dev' run: | set -eux - docker compose up --build -d + docker compose -f docker-compose.yml -f docker-compose.build.yml up --build -d docker compose -f docker-compose.test.yml --profile dev up - name: Integration test (prod) diff --git a/README.md b/README.md index 45829702..ae18a2b4 100644 --- a/README.md +++ b/README.md @@ -80,9 +80,6 @@ echo '127.0.0.1 phpmyadmin.example.com' | sudo tee -a /etc/hosts ## Development ```sh -# Setup docker buildx builder -docker buildx create --name mybuilder --driver docker-container --use - # 1. Start Counter-strike 1.6 server, source-udp-forwarder, HLStatsX:CE stack docker compose up --build # HLStatsX:CE web frontend available at http://localhost:8081/. Admin Panel username: admin, password 123456 diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 00000000..451e2cc6 --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,29 @@ +# This is a docker compose override file, for development builds with caching for CI environments +services: + daemon: + build: + cache_from: + - type=local,src=/tmp/.buildx-cache-daemon + cache_to: + - type=local,dest=/tmp/.buildx-cache-daemon,mode=max + + awards: + build: + cache_from: + - type=local,src=/tmp/.buildx-cache-daemon + cache_to: + - type=local,dest=/tmp/.buildx-cache-daemon,mode=max + + web: + build: + cache_from: + - type=local,src=/tmp/.buildx-cache-web + cache_to: + - type=local,dest=/tmp/.buildx-cache-web,mode=max + + heatmaps: + build: + cache_from: + - type=local,src=/tmp/.buildx-cache-web + cache_to: + - type=local,dest=/tmp/.buildx-cache-web,mode=max diff --git a/docker-compose.example.build.yml b/docker-compose.example.build.yml index 3a7c33b7..4ed0dfb2 100644 --- a/docker-compose.example.build.yml +++ b/docker-compose.example.build.yml @@ -1,5 +1,4 @@ -# This is a docker compose override file, for testing production builds -version: '2.2' +# This is a docker compose override file, for testing production builds with caching for CI environments services: daemon: build: diff --git a/docker-compose.yml b/docker-compose.yml index 4b0dccdd..b878a7cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -60,10 +60,6 @@ services: dockerfile: Dockerfile.daemon context: . target: dev - cache_from: - - type=local,src=/tmp/.buildx-cache-daemon - cache_to: - - type=local,dest=/tmp/.buildx-cache-daemon,mode=max ports: - 27500:27500/udp # For external servers to send logs to the daemon networks: @@ -86,10 +82,6 @@ services: dockerfile: Dockerfile.daemon context: . target: dev - cache_from: - - type=local,src=/tmp/.buildx-cache-daemon - cache_to: - - type=local,dest=/tmp/.buildx-cache-daemon,mode=max stop_signal: SIGKILL entrypoint: - /bin/sh @@ -140,10 +132,6 @@ services: dockerfile: Dockerfile.web context: . target: dev - cache_from: - - type=local,src=/tmp/.buildx-cache-web - cache_to: - - type=local,dest=/tmp/.buildx-cache-web,mode=max volumes: - ./web:/web # - ./config/web/supervisor.conf:/supervisor.conf:ro @@ -174,10 +162,6 @@ services: dockerfile: Dockerfile.web context: . target: dev - cache_from: - - type=local,src=/tmp/.buildx-cache-web - cache_to: - - type=local,dest=/tmp/.buildx-cache-web,mode=max volumes: - ./heatmaps:/heatmaps - ./web:/web