OpenFusion/Dockerfile

50 lines
857 B
Docker
Raw 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
ENV AUTHENTICATION_PORT 23000
ENV MONITORING_PORT 8003
ENV SHARDING_PORT 23001
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
EXPOSE $AUTHENTICATION_PORT
EXPOSE $MONITORING_PORT
EXPOSE $SHARDING_PORT
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