diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 91e1097a..9962722c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -44,15 +44,12 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: - platforms: | - - linux/amd64 - - linux/arm64 -# - linux/arm/v7 + platforms: linux/amd64,linux/arm64,linux/arm/v7 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Docker meta by docs https://github.com/docker/metadata-action + - name: Extract Docker metadata from environment id: meta uses: docker/metadata-action@v5 with: @@ -64,7 +61,7 @@ jobs: type=ref,event=tag type=sha,format=short,prefix= - - name: Build and export (multi-arch) + - name: Build and export Docker image uses: docker/build-push-action@v6 with: context: . @@ -72,8 +69,7 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - platforms: linux/amd64,linux/arm64 - #,linux/arm/v7 + platforms: linux/amd64,linux/arm64,linux/arm/v7 docker_scan: if: ${{ github.event_name != 'pull_request' }} diff --git a/.gitignore b/.gitignore index d7e92575..7bfd7528 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +*.tar .vscode .DS_Store .idea diff --git a/docker/Dockerfile b/docker/Dockerfile index e1b12e10..d73aecf8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,7 +22,8 @@ ENV CGO_ENABLED=1 # Change directory WORKDIR /workspace/awg # Compile the binaries -RUN go mod download && \ +RUN go version && \ + go mod download && \ go mod verify && \ go build -ldflags '-linkmode external -extldflags "-fno-PIC -static"' -v -o /usr/bin # @@ -56,12 +57,16 @@ RUN make && chmod +x wg* # Use the python-alpine image for building pip dependencies FROM python:3.14-alpine AS pip-builder +ARG TARGETPLATFORM + # Add the build dependencies and create a Python virtual environment. RUN apk add --no-cache \ build-base \ pkgconfig \ python3-dev \ + postgresql-dev \ libffi-dev \ + libpq \ linux-headers \ rust \ cargo \ @@ -70,6 +75,11 @@ RUN apk add --no-cache \ # Copy the requirements file into the build layer. COPY ./src/requirements.txt /opt/wgdashboard/src +RUN if [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \ + sed -i "s|psycopg\[binary\]==3.2.13|psycopg\[c\]==3.2.13|" /opt/wgdashboard/src/requirements.txt; \ + fi; \ + cat /opt/wgdashboard/src/requirements.txt + # Install the pip packages RUN . /opt/wgdashboard/src/venv/bin/activate && \ pip3 install --upgrade pip && \ @@ -133,7 +143,7 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ # Copy in the runtime script, essential. COPY ./docker/entrypoint.sh /entrypoint.sh -# +# Expose ports on the container EXPOSE 10086 WORKDIR $WGDASH/src