1
0
Fork 0

Migrate build assets and scripts to deploy/docker structure

- Removed `install.sh` and moved Docker-related assets to `deploy/docker`.
- Updated all Dockerfile references from `build/` to `deploy/docker/`.
- Refactored paths in E2E tests, Makefile, and documentation for consistency with new directory structure.
- Added `HAPROXY_STATS_CORS_ORIGIN` environment variable in `docker-compose.yml`.
This commit is contained in:
Joao Gilberto Magalhaes 2026-02-18 02:58:32 -05:00
parent 53c32499b5
commit 48f6e1f783
30 changed files with 20 additions and 49 deletions

View file

@ -201,7 +201,7 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: build/Dockerfile file: deploy/docker/Dockerfile
build-args: | build-args: |
RELEASE_VERSION_ARG="${{ steps.tags.outputs.result }}" RELEASE_VERSION_ARG="${{ steps.tags.outputs.result }}"
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64

View file

@ -2,7 +2,7 @@ VERSION := $(shell git rev-parse --short HEAD)
.PHONY: build .PHONY: build
build: build:
docker build -t byjg/easy-haproxy --build-arg RELEASE_VERSION_ARG="$(VERSION)" -t byjg/easy-haproxy:local -f build/Dockerfile . docker build -t byjg/easy-haproxy --build-arg RELEASE_VERSION_ARG="$(VERSION)" -t byjg/easy-haproxy:local -f deploy/docker/Dockerfile .
.PHONY: test .PHONY: test
test: test:

View file

@ -80,7 +80,7 @@ The automated release process is triggered by pushing a semantic version tag.
```bash ```bash
make build make build
# Or manually: # Or manually:
docker build -t byjg/easy-haproxy:local -f build/Dockerfile . docker build -t byjg/easy-haproxy:local -f deploy/docker/Dockerfile .
``` ```
### Step 2: Bump Versions (script + PR) ### Step 2: Bump Versions (script + PR)

View file

@ -17,7 +17,7 @@ podman run --rm --events-backend=file --cgroup-manager=cgroupfs --privileged doc
for VERSION in $VERSIONS for VERSION in $VERSIONS
do do
DOCKERFILE=build/Dockerfile DOCKERFILE=deploy/docker/Dockerfile
buildah manifest create byjg/easy-haproxy:$VERSION buildah manifest create byjg/easy-haproxy:$VERSION

View file

@ -43,8 +43,7 @@ RUN apk add --no-cache certbot openssl bash curl su-exec \
&& cat /tmp/placeholder.crt /tmp/placeholder.key > /etc/easyhaproxy/certs/haproxy/placeholder.pem \ && cat /tmp/placeholder.crt /tmp/placeholder.key > /etc/easyhaproxy/certs/haproxy/placeholder.pem \
&& rm /tmp/placeholder.key /tmp/placeholder.crt && rm /tmp/placeholder.key /tmp/placeholder.crt
COPY build/assets / COPY deploy/docker/assets /
COPY build/entrypoint.sh /entrypoint.sh
COPY --from=builder /scripts /scripts COPY --from=builder /scripts /scripts
RUN chmod +x /entrypoint.sh \ RUN chmod +x /entrypoint.sh \

View file

View file

@ -20,6 +20,7 @@ services:
HAPROXY_USERNAME: admin HAPROXY_USERNAME: admin
HAPROXY_PASSWORD: password HAPROXY_PASSWORD: password
HAPROXY_STATS_PORT: 1936 HAPROXY_STATS_PORT: 1936
HAPROXY_STATS_CORS_ORIGIN: "http://localhost:8080"
ports: ports:
- "80:80/tcp" - "80:80/tcp"

View file

@ -1,29 +0,0 @@
#!/bin/bash
ASSETS_DIR="$(dirname "${BASH_SOURCE[0]}")"/../../build/assets/certs/haproxy
docker network create easyhaproxy
docker volume create certs_certbot
docker volume create certs_haproxy
docker run -d --rm --name easyhaproxy_install -v certs_haproxy:/certs alpine tail -f /dev/null
docker cp $ASSETS_DIR/place_holder_cert.pem easyhaproxy_install:/certs/place_holder_cert.pem
docker stop easyhaproxy_install
echo
echo
echo make sure to add to all of your containers:
echo
echo docker-compose
echo ==============
echo "networks:"
echo " default:"
echo " name: easyhaproxy"
echo " external: true"
echo
echo
echo docker run
echo ==============
echo docker run ... --network easyhaproxy ... your_image:tag
echo

View file

@ -13,6 +13,6 @@
1. Investigate the source code in src/* 1. Investigate the source code in src/*
2. Try to fix it. 2. Try to fix it.
3. After the code is changed, build it again: `docker build -t byjg/easy-haproxy:5.0.0 -f build/Dockerfile --no-cache .` and start the tests again. 3. After the code is changed, build it again: `docker build -t byjg/easy-haproxy:5.0.0 -f deploy/docker/Dockerfile --no-cache .` and start the tests again.

View file

@ -96,7 +96,7 @@ services:
haproxy: haproxy:
build: build:
context: ../.. context: ../..
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
depends_on: depends_on:
pebble_health: pebble_health:
condition: service_healthy condition: service_healthy

View file

@ -35,7 +35,7 @@ services:
haproxy: haproxy:
build: build:
context: ../../ context: ../../
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -48,7 +48,7 @@ services:
haproxy: haproxy:
build: build:
context: ../.. context: ../..
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -44,7 +44,7 @@ services:
haproxy: haproxy:
build: build:
context: ../../ context: ../../
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -52,7 +52,7 @@ services:
haproxy: haproxy:
build: build:
context: ../.. context: ../..
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -48,7 +48,7 @@ services:
haproxy: haproxy:
build: build:
context: ../../ context: ../../
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -46,7 +46,7 @@ services:
haproxy: haproxy:
build: build:
context: ../../ context: ../../
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -64,7 +64,7 @@ services:
haproxy: haproxy:
build: build:
context: ../../ context: ../../
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -17,7 +17,7 @@ services:
haproxy: haproxy:
build: build:
context: ../.. context: ../..
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -50,7 +50,7 @@ services:
haproxy: haproxy:
build: build:
context: ../.. context: ../..
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View file

@ -109,7 +109,7 @@ echo -e "${GREEN}✓ kind cluster '${CLUSTER_NAME}' is ready${NC}"
# Build and load local EasyHAProxy image # Build and load local EasyHAProxy image
echo -e "${BLUE}[4/9] Building local EasyHAProxy image (may take 30-60s)...${NC}" echo -e "${BLUE}[4/9] Building local EasyHAProxy image (may take 30-60s)...${NC}"
docker build -t byjg/easy-haproxy:local \ docker build -t byjg/easy-haproxy:local \
-f "${PROJECT_ROOT}/build/Dockerfile" \ -f "${PROJECT_ROOT}/deploy/docker/Dockerfile" \
"${PROJECT_ROOT}" "${PROJECT_ROOT}"
echo -e "${BLUE}[5/9] Loading image into kind cluster (may take 10-20s)...${NC}" echo -e "${BLUE}[5/9] Loading image into kind cluster (may take 10-20s)...${NC}"

View file

@ -63,7 +63,7 @@ services:
image: byjg/easy-haproxy:local image: byjg/easy-haproxy:local
build: build:
context: ../.. context: ../..
dockerfile: build/Dockerfile dockerfile: deploy/docker/Dockerfile
volumes: volumes:
- ./conf/:/etc/easyhaproxy/static/ - ./conf/:/etc/easyhaproxy/static/
- ../static/host1.local.pem:/etc/easyhaproxy/certs/haproxy/host1.local.pem:ro - ../static/host1.local.pem:/etc/easyhaproxy/certs/haproxy/host1.local.pem:ro

View file

@ -326,7 +326,7 @@ nodes:
project_root = BASE_DIR.parent project_root = BASE_DIR.parent
subprocess.run( subprocess.run(
["docker", "build", "-t", "byjg/easy-haproxy:local", ["docker", "build", "-t", "byjg/easy-haproxy:local",
"-f", str(project_root / "build" / "Dockerfile"), "-f", str(project_root / "deploy" / "docker" / "Dockerfile"),
str(project_root)], str(project_root)],
check=True, check=True,
capture_output=True, capture_output=True,