From 0e59be74216f6bbb65aecb1002adb88a60f3e8e7 Mon Sep 17 00:00:00 2001 From: MartynaSab Date: Fri, 3 Jan 2025 19:53:23 +0100 Subject: [PATCH] added multi-stage builds to dockerfile --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5d7faa..6b13157 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,10 @@ FROM debian:12-slim RUN apt update && apt install golang -y --no-install-recommends && apt install ca-certificates -y RUN mkdir /src && mkdir /conf COPY . /src -RUN cd /src && go build && mv alarm_bot .. && cd .. && rm -r src && apt remove golang -y && apt autoremove -y +RUN cd /src && go build + +FROM debian:12-slim +COPY --from=0 /conf /conf +COPY --from=0 /src/alarm_bot / WORKDIR /conf -CMD /alarm_bot \ No newline at end of file +CMD ["/alarm_bot"] \ No newline at end of file