Merge build and run in dockerfile

This commit is contained in:
2023-09-28 01:33:10 -05:00
parent 8c6b4b9f76
commit dce50642a0

View File

@@ -1,16 +1,8 @@
FROM debian:stable-slim AS build FROM debian:stable-slim AS build
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgnutls28-dev libgnutls30 gcc make pkg-config RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgnutls28-dev libgnutls30 gcc make pkg-config
COPY . /swebs COPY . /swebs
WORKDIR /swebs WORKDIR /swebs
RUN make RUN make && make install
FROM debian:stable-slim AS run
RUN apt-get update -y && apt-get upgrade -y && apt-get install -y libgnutls28-dev libgnutls30
COPY --from=build /swebs/build/swebs /usr/sbin/swebs
RUN mkdir /usr/include/swebs
COPY --from=build /swebs/src/swebs /usr/include/swebs/
RUN useradd -M swebs
ENTRYPOINT [ "swebs", "-s", "/site/sitefile" ] ENTRYPOINT [ "swebs", "-s", "/site/sitefile" ]