FROM node:10-jessie as node #If encounter Invalid cross-device error -run on host 'echo N | sudo tee /sys/module/overlay/parameters/metacopy' COPY server/ui /app/server/ui RUN cd /app/server/ui && yarn && yarn build FROM rust:1.30 as rust COPY server/service /app/server/service RUN cd /app/server/service && cargo build --release FROM debian:jessie-slim as volume COPY torrents.csv /db/ COPY torrent_files.json /db/ FROM debian:jessie-slim RUN apt update && apt install -y sqlite3 curl RUN curl -LO https://github.com/BurntSushi/ripgrep/releases/download/0.10.0/ripgrep_0.10.0_amd64.deb RUN dpkg -i ripgrep_0.10.0_amd64.deb RUN curl -LO https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 RUN chmod +x jq-linux64 RUN mv jq-linux64 /usr/bin/jq COPY --from=node /app/server/ui/dist /app/dist COPY --from=rust /app/server/service/target/release/torrents-csv-service /app/ COPY --from=volume /db/torrents.csv /app/ COPY --from=volume /db/torrent_files.json /app/ COPY scripts /app/scripts WORKDIR /app/scripts/ RUN ["/bin/bash", "-c", "/app/scripts/build_sqlite.sh"] EXPOSE 8080 WORKDIR /app/ ARG TORRENTS_CSV_DB_FILE RUN sqlite3 ${TORRENTS_CSV_DB_FILE} 'select * from torrents limit 10'