FROM alpine:latest

WORKDIR /alephone-hub

COPY . /alephone-hub

RUN apk add --no-cache alpine-sdk automake autoconf-archive \
           boost-dev sdl2-dev sdl2_net-dev sdl2_ttf-dev \
           openal-soft-dev libsndfile-dev \
         && autoreconf -i \
         && ./configure --enable-standalone-hub --disable-opengl \
         && make -j$(nproc) \
         && make install

FROM alpine:latest

RUN apk add --no-cache \
           boost-filesystem sdl2 \
           sdl2_net sdl2_ttf \
           openal-soft libsndfile

COPY --from=0 /usr/local/bin/standalone_hub .

ENTRYPOINT ["./standalone_hub"]