Files
AdGuardHome/docker/frontend.Dockerfile
T
Dimitry Kolyshev 82f2ac68ab Pull request: ADG-11407-add-docker-ci
Squashed commit of the following:

commit f9344df7c9f76a76135c21d200003338c3cb3282
Merge: 563f46c18 94a3a4fa6
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Fri Feb 20 09:45:05 2026 +0700

    Merge remote-tracking branch 'origin/master' into ADG-11407-add-docker-ci

commit 563f46c18a31817a53d97b8395706551826a4c43
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Thu Feb 19 11:44:15 2026 +0700

    docker: fix e2e

commit bcb68f6cee616983cd55e297f5d06a9fa389230a
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Feb 18 13:10:48 2026 +0700

    docker: rm info e2e

commit b48cc46b7c7126f87266edac73f1135f5fffd6a2
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Feb 18 12:59:50 2026 +0700

    docker: info e2e

commit 9cb7ec0a7d27a2cf0c1a3424061b88296bcabc10
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Feb 18 12:15:32 2026 +0700

    docker: fix e2e

commit e6e0d7f65c71cb7cc926011fb1012b31d7070084
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Feb 17 12:18:06 2026 +0700

    docker: artifacts

commit 2a28805f213b48ce601eebed00588450893d93e8
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Feb 17 12:16:28 2026 +0700

    Revert "docker: fix e2e"
    
    This reverts commit e31a4d9056ffe4f03398a83bfb73f262324963fa.

commit a6548ee9204f316b00663dd164d0b9627a6d5a6c
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Feb 17 12:11:56 2026 +0700

    docker: artifacts

commit e31a4d9056ffe4f03398a83bfb73f262324963fa
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Feb 17 12:06:40 2026 +0700

    docker: fix e2e

commit 66aa5a33330ec6b07e9754678a2c4bb6f280bccb
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Tue Feb 17 11:12:29 2026 +0700

    docker: fix e2e

commit 1947763317d5822db16e1ae0611bf78d274da441
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Mon Feb 16 15:58:26 2026 +0700

    docker: fix

commit 537a97239529540e6e850b4df8c28122c247812b
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Mon Feb 16 15:45:24 2026 +0700

    docker: imp

commit a3894cef0c3c6e38c04a55c3a859b501d7f481d6
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Mon Feb 16 15:42:27 2026 +0700

    docker: imp

commit c835a768fd6c7786c812b6f207810ae7d33d5f68
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Mon Feb 16 15:38:37 2026 +0700

    docker: imp

commit 74cfdd0ec9706ac9f963a484920a0d3046d739e6
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Mon Feb 16 15:35:56 2026 +0700

    docker: imp

commit 02219a3e9c35e1d3e9a852a5e55f6549b69fdff2
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Mon Feb 16 15:33:20 2026 +0700

    docker: ci frontend

commit 120f0b8afb9f30ac9b664108c9fcaa915cea5bf3
Merge: d31272bb0 a165cdb68
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Mon Feb 16 09:58:58 2026 +0700

    Merge remote-tracking branch 'refs/remotes/origin/master' into ADG-11407-add-docker-ci
    
    # Conflicts:
    #	bamboo-specs/test.yaml

commit d31272bb0e77f560d9ca7109d5285f2af50bb309
Author: Dimitry Kolyshev <dkolyshev@adguard.com>
Date:   Wed Jan 28 11:05:06 2026 +0700

    all: add docker ci
2026-02-20 03:37:47 +00:00

119 lines
2.9 KiB
Docker

# syntax=docker/dockerfile:1
# This comment is used to simplify checking local copies of the Dockerfile.
# Bump this number every time a significant change is made to this Dockerfile.
#
# AdGuard-Project-Version: 11
# Dockerfile guidelines:
#
# 1. Make sure that Docker correctly caches layers, on a second build attempt it
# must not run lint / test second time when it's not required.
#
# 2. Use BuildKit to improve the build performance (--mount=type=cache, etc).
#
# 3. Prefer using ARG instead of ENV when appropriate, as ARG does not create a
# layer in the final image. However, be careful with what you use ARG for.
# Also, prefer to give ARGs sensible default values.
#
# 4. Use --output and the export stage if you need to get any output on the host
# machine.
#
# NOTE: Only use --output with FROM scratch.
#
# 5. Use .dockerignore to prevent unnecessary files from being sent to the
# Docker daemon, which can invalidate the cache.
#
# 6. Add a CACHE_BUSTER argument to stages to be able to rerun the stages if
# needed. Keep it in sync with bamboo-specs/bamboo.yaml.
# NOTE: Keep in sync with bamboo-specs/bamboo.yaml.
ARG BASE_IMAGE=adguard/home-js-builder:4.0
# The dependencies stage is needed to install packages and tool dependencies.
# This is also where binaries like osslsigncode, which may be required for tests
# in some projects, must be installed.
#
# NOTE: Only ADD the files required to install the dependencies.
FROM "$BASE_IMAGE" AS dependencies
ADD Makefile /app/
ADD scripts /app/scripts
ADD client /app/client
WORKDIR /app
RUN \
--mount=type=cache,id=npm-root-cache,target=/root/.npm \
<<-'EOF'
set -e -f -u -x
make \
VERBOSE=1 \
js-deps \
;
EOF
# The linter stage is separated from the tester stage to make catching test
# failures easier.
FROM dependencies AS linter
ARG CACHE_BUSTER=0
ADD . /app
WORKDIR /app
RUN \
--mount=type=cache,id=npm-root-cache,target=/root/.npm \
<<-'EOF'
set -e -f -u -x
make \
VERBOSE=1 \
js-typecheck \
js-lint \
;
EOF
# The test stage.
FROM linter AS tester
ARG CACHE_BUSTER=0
RUN \
--mount=type=cache,id=npm-root-cache,target=/root/.npm \
<<-'EOF'
set -e -f -u -x
make \
VERBOSE=1 \
js-test \
;
EOF
# The e2e test stage.
FROM dependencies AS e2etester
ARG CACHE_BUSTER=0
ADD . /app
WORKDIR /app
RUN \
--mount=type=cache,id=npm-root-cache,target=/root/.npm \
<<-'EOF'
set -e -f -u -x
make \
CI='true' \
VERBOSE=1 \
js-test-e2e \
;
EOF
# The builder stage.
FROM dependencies AS builder
ARG CACHE_BUSTER=0
ADD . /app
WORKDIR /app
RUN \
--mount=type=cache,id=npm-root-cache,target=/root/.npm \
<<-'EOF'
set -e -f -u -x
make \
VERBOSE=1 \
js-build \
;
EOF
# builder-exporter exports the build artifacts to the host machine so that they
# could be published. This stage should only be used in a CI.
FROM scratch AS builder-exporter
ARG CACHE_BUSTER=0
COPY --from=builder /app/build /build