Speed up Docker rebuilds
This commit is contained in:
+7
-2
@@ -1,9 +1,11 @@
|
|||||||
|
# syntax=docker/dockerfile:1.7
|
||||||
|
|
||||||
# --- Builder Stage ---
|
# --- Builder Stage ---
|
||||||
FROM ubuntu:22.04 AS builder
|
FROM ubuntu:22.04 AS builder
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
build-essential cmake ninja-build git pkg-config \
|
build-essential ccache cmake ninja-build git pkg-config \
|
||||||
libssl-dev zlib1g-dev \
|
libssl-dev zlib1g-dev \
|
||||||
libmariadb-dev libmariadb-dev-compat \
|
libmariadb-dev libmariadb-dev-compat \
|
||||||
libsqlite3-dev python3 libjsoncpp-dev uuid-dev ca-certificates \
|
libsqlite3-dev python3 libjsoncpp-dev uuid-dev ca-certificates \
|
||||||
@@ -14,7 +16,10 @@ RUN rm -rf /usr/include/mysql && ln -s /usr/include/mariadb /usr/include/mysql
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
RUN --mount=type=cache,target=/app/.cache/cpm \
|
||||||
|
--mount=type=cache,target=/root/.cache/ccache \
|
||||||
|
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||||
&& cmake --build build
|
&& cmake --build build
|
||||||
|
|
||||||
# --- Runtime Stage ---
|
# --- Runtime Stage ---
|
||||||
|
|||||||
@@ -147,6 +147,9 @@ Set `DB_NAME`, `DB_USER`, `DB_PASSWORD`, `MYSQL_ROOT_PASSWORD` and
|
|||||||
origin without quotes or a trailing slash, for example
|
origin without quotes or a trailing slash, for example
|
||||||
`https://visione.studentindipendenti.it`.
|
`https://visione.studentindipendenti.it`.
|
||||||
|
|
||||||
|
Docker builds use BuildKit cache mounts for CPM dependencies and `ccache`, so
|
||||||
|
repeat Dokploy builds can reuse Drogon and C++ compilation cache.
|
||||||
|
|
||||||
## Current Endpoints
|
## Current Endpoints
|
||||||
|
|
||||||
- `GET /api/v1/health`: process health check, no external dependency.
|
- `GET /api/v1/health`: process health check, no external dependency.
|
||||||
|
|||||||
Reference in New Issue
Block a user