OpenFusion/Dockerfile

46 lines
785 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
2023-06-23 01:46:24 +00:00
RUN make -j8
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
2024-05-08 03:11:14 +00:00
LABEL Name=openfusion Version=0.0.2