OpenFusion/Dockerfile

42 lines
694 B
Docker
Raw Permalink Normal View History

2024-05-08 03:11:14 +00:00
# build
FROM alpine:3 as build
2023-06-23 01:46:24 +00:00
WORKDIR /usr/src/app
RUN apk update && apk upgrade && apk add \
linux-headers \
2023-06-23 01:46:24 +00:00
git \
clang18 \
2023-06-23 01:46:24 +00:00
make \
sqlite-dev
2023-06-23 01:46:24 +00:00
2024-05-08 03:11:14 +00:00
COPY src ./src
COPY vendor ./vendor
COPY .git ./.git
COPY Makefile CMakeLists.txt version.h.in ./
2023-06-23 01:46:24 +00:00
RUN sed -i 's/^CC=clang$/&-18/' Makefile
RUN sed -i 's/^CXX=clang++$/&-18/' Makefile
RUN make nosandbox -j$(nproc)
2023-06-23 01:46:24 +00:00
2024-05-08 03:11:14 +00:00
# prod
FROM alpine:3
2024-05-08 03:11:14 +00:00
WORKDIR /usr/src/app
RUN apk update && apk upgrade && apk add \
libstdc++ \
sqlite-dev
2024-05-08 03:11:14 +00:00
COPY --from=build /usr/src/app/bin/fusion /bin/fusion
COPY sql ./sql
2023-06-23 01:46:24 +00:00
2024-05-08 03:11:14 +00:00
CMD ["/bin/fusion"]
2023-06-23 01:46:24 +00:00
EXPOSE 23000/tcp
EXPOSE 23001/tcp
EXPOSE 8003/tcp
LABEL Name=openfusion Version=1.6.0