add benchmark result and fix Dockerfile names since it does not depends on architecture

This commit is contained in:
Jun Kurihara 2023-07-24 20:08:18 +09:00
commit 7f52dce23d
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
11 changed files with 354 additions and 19 deletions

55
docker/Dockerfile Normal file
View file

@ -0,0 +1,55 @@
FROM ubuntu:22.04 AS base
LABEL maintainer="Jun Kurihara"
SHELL ["/bin/sh", "-x", "-c"]
ENV SERIAL 2
########################################
FROM base as builder
ENV CFLAGS=-Ofast
ENV BUILD_DEPS curl make ca-certificates build-essential
WORKDIR /tmp
COPY . /tmp/
ENV RUSTFLAGS "-C link-arg=-s"
RUN update-ca-certificates 2> /dev/null || true
RUN apt-get update && apt-get install -qy --no-install-recommends $BUILD_DEPS && \
curl -sSf https://sh.rustup.rs | bash -s -- -y --default-toolchain stable && \
export PATH="$HOME/.cargo/bin:$PATH" && \
echo "Building rpxy from source" && \
cargo build --release && \
strip --strip-all /tmp/target/release/rpxy
########################################
FROM base AS runner
ENV RUNTIME_DEPS logrotate ca-certificates gosu
RUN apt-get update && \
apt-get install -qy --no-install-recommends $RUNTIME_DEPS && \
apt-get -qy clean && \
apt-get -qy autoremove && \
rm -fr /tmp/* /var/tmp/* /var/cache/apt/* /var/lib/apt/lists/* /var/log/apt/* /var/log/*.log && \
find / -type d -path /proc -prune -o -type f -perm /u+s -ignore_readdir_race -exec chmod u-s {} \; && \
find / -type d -path /proc -prune -o -type f -perm /g+s -ignore_readdir_race -exec chmod g-s {} \; && \
mkdir -p /rpxy/bin &&\
mkdir -p /rpxy/log
COPY --from=builder /tmp/target/release/rpxy /rpxy/bin/rpxy
COPY ./docker/run.sh /rpxy
COPY ./docker/entrypoint.sh /rpxy
RUN chmod +x /rpxy/run.sh && \
chmod +x /rpxy/entrypoint.sh
EXPOSE 80 443
CMD ["/usr/bin/bash" "/rpxy/entrypoint.sh"]
ENTRYPOINT ["/usr/bin/bash", "/rpxy/entrypoint.sh"]