woo.dockerfile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. FROM debian:bullseye-slim AS debian
  2. ENV DEBIAN_FRONTEND noninteractive
  3. ENV TERM linux
  4. ENV ROS_VERSION 22.12.14.113
  5. ENV LISP sbcl-bin/2.3.4
  6. ENV ASDF_VERSION 3.3.6
  7. ENV QUICKLISP_VERSION 2023-02-15
  8. RUN echo 'APT::Get::Install-Recommends "false";' > /etc/apt/apt.conf.d/00-general \
  9. && echo 'APT::Get::Install-Suggests "false";' >> /etc/apt/apt.conf.d/00-general \
  10. && echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf.d/00-general \
  11. && echo 'APT::Get::force-yes "true";' >> /etc/apt/apt.conf.d/00-general
  12. FROM debian AS roswell
  13. RUN apt-get update -q \
  14. && apt-get install --no-install-recommends -q -y \
  15. bzip2 \
  16. ca-certificates curl libcurl3-gnutls \
  17. make \
  18. && rm -rf /var/lib/apt/lists/* \
  19. && curl -L -O https://github.com/roswell/roswell/releases/download/v${ROS_VERSION}/roswell_${ROS_VERSION}-1_amd64.deb \
  20. && dpkg -i roswell_${ROS_VERSION}-1_amd64.deb \
  21. && ros quicklisp.dist=http://beta.quicklisp.org/dist/quicklisp/${QUICKLISP_VERSION}/distinfo.txt setup \
  22. && ros install ${LISP} \
  23. && ros use ${LISP} \
  24. && ros install asdf/${ASDF_VERSION} \
  25. && ros config \
  26. && rm roswell_${ROS_VERSION}-1_amd64.deb
  27. RUN echo 'export PATH=$HOME/.roswell/bin:$PATH' >> ~/.bashrc
  28. FROM roswell AS builder
  29. RUN apt-get update -q \
  30. && apt-get install --no-install-recommends -q -y \
  31. git \
  32. build-essential \
  33. libev-dev \
  34. && rm -rf /var/lib/apt/lists/*
  35. WORKDIR /woo
  36. ADD . .
  37. # Some of the patches are not merged or not available in Quicklisp yet:
  38. #
  39. # - https://github.com/fukamachi/fast-http/pull/40
  40. # - https://github.com/fukamachi/woo/pull/104
  41. # - https://github.com/marijnh/Postmodern/pull/321
  42. #
  43. RUN mkdir -p /libs && \
  44. git clone --branch http-pipelining https://github.com/svetlyak40wt/fast-http /libs/fast-http && \
  45. git clone --branch fix-error-codes https://github.com/svetlyak40wt/woo /libs/woo && \
  46. git clone --branch fix-defprepared-threadsafety https://github.com/svetlyak40wt/Postmodern /libs/Postmodern
  47. RUN CL_SOURCE_REGISTRY=/libs// ros build woo.ros
  48. FROM debian
  49. RUN apt-get update -q \
  50. && apt-get install --no-install-recommends -q -y \
  51. libev4 \
  52. && rm -rf /var/lib/apt/lists/*
  53. WORKDIR /woo
  54. COPY --from=builder /woo/woo .
  55. RUN ["chmod", "+x", "./woo"]
  56. EXPOSE 8080
  57. EXPOSE 4005
  58. CMD ./woo --cpu $(nproc) --address 0.0.0.0 --port 8080