1
Fork 0
hare-playground/backend/Dockerfile
2024-06-01 16:45:25 +02:00

49 lines
1.1 KiB
Docker

FROM ubuntu:24.04 as harebuild
RUN apt-get update -qq \
&& apt-get install -qy --no-install-recommends \
build-essential \
git \
scdoc \
ca-certificates \
wget
RUN wget https://c9x.me/compile/release/qbe-1.2.tar.xz && \
tar -xf qbe-1.2.tar.xz && \
cd qbe-1.2 && \
make && \
make install
RUN git clone https://git.sr.ht/~sircmpwn/harec && \
cd harec && \
cp configs/linux.mk config.mk && \
make && \
make install
RUN git clone https://git.sr.ht/~sircmpwn/hare && \
cd hare && \
cp configs/linux.mk config.mk && \
make && \
make install
WORKDIR /src
COPY ./ ./
RUN make -B httpd HAREPATH=/usr/local/src/hare/stdlib HAREFLAGS=-lpthread
FROM ubuntu:24.04
RUN apt-get update -qq \
&& apt-get install -qy --no-install-recommends \
ca-certificates \
tzdata \
bubblewrap \
binutils \
vim
COPY --from=harebuild /usr/local /usr/local
COPY --from=harebuild /src/httpd /usr/local/bin/backend
COPY ./frontend/ /app/
WORKDIR /app
ENTRYPOINT ["/usr/local/bin/backend", "-a", "0.0.0.0:8080"]