From 359de79eaa4155ab37f1dd46d851c7c697971058 Mon Sep 17 00:00:00 2001 From: Juansecu Date: Sat, 8 Jun 2024 21:55:03 -0500 Subject: [PATCH] BUILD - Optimize Dockerfile by using alpine as base image --- Dockerfile | 21 +++++++++++++-------- src/settings.hpp | 3 ++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index d74e3e5..d9c358d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,33 @@ # build -FROM debian:stable-slim AS build +FROM alpine:3 as build WORKDIR /usr/src/app -RUN apt-get -y update && apt-get install -y \ +RUN apk update && apk upgrade && apk add \ +linux-headers \ git \ -clang \ +clang18 \ make \ -libsqlite3-dev +sqlite-dev COPY src ./src COPY vendor ./vendor COPY .git ./.git COPY Makefile CMakeLists.txt version.h.in ./ +RUN sed -i 's/^CC=clang$/&-18/' Makefile +RUN sed -i 's/^CXX=clang++$/&-18/' Makefile + RUN make nosandbox -j$(nproc) # prod -FROM debian:stable-slim +FROM alpine:3 WORKDIR /usr/src/app -RUN apt-get -y update && apt-get install -y \ -libsqlite3-dev +RUN apk update && apk upgrade && apk add \ +libstdc++ \ +sqlite-dev COPY --from=build /usr/src/app/bin/fusion /bin/fusion COPY sql ./sql @@ -31,6 +36,6 @@ CMD ["/bin/fusion"] EXPOSE 23000/tcp EXPOSE 23001/tcp -EXPOSE 8001/tcp +EXPOSE 8003/tcp LABEL Name=openfusion Version=1.6.0 diff --git a/src/settings.hpp b/src/settings.hpp index 2709932..ac53d4c 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -1,5 +1,6 @@ #pragma once +#include #include namespace settings { @@ -15,7 +16,7 @@ namespace settings { extern std::string SHARDSERVERIP; extern bool LOCALHOSTWORKAROUND; extern bool ANTICHEAT; - extern time_t TIMEOUT; + extern int64_t TIMEOUT; extern int VIEWDISTANCE; extern bool SIMULATEMOBS; extern int SPAWN_X;