chirpstack/Dockerfile

33 lines
877 B
Docker
Raw Normal View History

FROM alpine:3.15.0 AS ui-build
2022-04-06 20:18:32 +00:00
ENV PROJECT_PATH=/chirpstack
RUN apk add --no-cache make git bash build-base nodejs npm yarn
RUN mkdir -p $PROJECT_PATH
COPY ./api/grpc-web $PROJECT_PATH/api/grpc-web
COPY ./ui $PROJECT_PATH/ui
2022-04-06 20:18:32 +00:00
2022-04-18 20:19:24 +00:00
RUN cd $PROJECT_PATH/ui && \
yarn install --network-timeout 600000 && \
yarn build
2022-04-18 20:19:24 +00:00
FROM chirpstack/chirpstack-dev-cache:latest AS rust-build
COPY . $PROJECT_PATH
COPY --from=ui-build $PROJECT_PATH/ui/build $PROJECT_PATH/ui/build
2022-04-06 20:18:32 +00:00
RUN cd $PROJECT_PATH/chirpstack && cargo build --release
2022-04-18 20:19:24 +00:00
FROM debian:buster-slim as production
RUN apt-get update && \
apt-get install -y \
ca-certificates \
libpq5 \
&& rm -rf /var/lib/apt/lists/*
2022-04-06 20:18:32 +00:00
COPY --from=rust-build /target/release/chirpstack /usr/bin/chirpstack
COPY --from=rust-build /chirpstack/chirpstack/configuration/* /etc/chirpstack/
2022-04-06 20:18:32 +00:00
USER nobody:nogroup
ENTRYPOINT ["/usr/bin/chirpstack"]