From 333ccc7385db0eb6151c1a163e5ea2ac2702012e Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 25 Apr 2024 04:28:29 +0200 Subject: Makefile: separate shortcuts for debug & release builds --- Dockerfile | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 60f1f31..1a472b5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,23 @@ FROM alpine:3.19 AS base -ARG install_dir="/app/install" - FROM base AS builder RUN build_deps='bash bsd-compat-headers build-base clang cmake coreutils git json-c-dev libgit2-dev libsodium-dev py3-pytest sqlite-dev valgrind' && \ apk add -q --no-cache $build_deps ARG COMPILER=clang -ARG CONFIGURATION=Release ARG DEFAULT_HOST=127.0.0.1 ARG DEFAULT_PORT=5556 -ARG src_dir="/app/src" -ARG install_dir - -COPY [".", "$src_dir"] +COPY [".", "/app"] -RUN cd -- "$src_dir" && \ - make install \ +RUN cd -- "/app" && \ + make release/install \ "COMPILER=$COMPILER" \ - "CONFIGURATION=$CONFIGURATION" \ "DEFAULT_HOST=$DEFAULT_HOST" \ - "DEFAULT_PORT=$DEFAULT_PORT" \ - "INSTALL_PREFIX=$install_dir" && \ + "DEFAULT_PORT=$DEFAULT_PORT" && \ ulimit -n 1024 && \ - make test/docker + make release/sanity FROM base @@ -34,11 +26,10 @@ LABEL maintainer="Egor Tensin " RUN runtime_deps='json-c libgit2 libsodium sqlite tini' && \ apk add -q --no-cache $runtime_deps -ARG install_dir -COPY --from=builder ["$install_dir", "$install_dir"] +COPY --from=builder ["/app/build/release/install", "/app"] -ENV PATH="$install_dir/bin:${PATH}" -WORKDIR "$install_dir/bin" +ENV PATH="/app/bin:${PATH}" +WORKDIR "/app/bin" ENTRYPOINT ["/sbin/tini", "--"] CMD ["cimple-server"] -- cgit v1.2.3