warpgate/docker/Dockerfile

41 lines
957 B
Docker
Raw Normal View History

2022-10-30 18:06:05 +08:00
# syntax=docker/dockerfile:1.3-labs
2024-07-16 18:44:23 +08:00
FROM rust:1.79.0-bullseye AS build
2022-04-11 14:56:19 +08:00
ENV DEBIAN_FRONTEND noninteractive
2024-03-15 06:00:24 +08:00
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
2022-04-11 14:56:19 +08:00
&& apt-get update \
2023-07-11 03:38:08 +08:00
&& apt-get install -y ca-certificates-java nodejs openjdk-17-jdk \
2022-04-11 14:56:19 +08:00
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn \
&& cargo install just
COPY . /opt/warpgate
RUN cd /opt/warpgate \
2022-11-18 06:32:40 +08:00
&& just yarn --network-timeout 1000000000 \
&& just openapi \
2022-04-11 14:56:19 +08:00
&& just yarn build \
&& cargo build --features mysql,postgres --release
2022-04-11 14:56:19 +08:00
2022-10-30 18:06:05 +08:00
FROM debian:bullseye-20221024
2022-04-11 14:56:19 +08:00
LABEL maintainer=heywoodlh
ENV DEBIAN_FRONTEND noninteractive
RUN <<EOF
set -xe
apt-get -y update -qq
apt-get install --no-install-recommends -y \
ca-certificates
apt clean
EOF
COPY --from=build /opt/warpgate/target/release/warpgate /usr/local/bin/warpgate
2022-04-11 14:56:19 +08:00
VOLUME /data
2022-07-06 03:32:05 +08:00
ENV DOCKER 1
ENTRYPOINT ["warpgate", "--config", "/data/warpgate.yaml"]
CMD ["run"]