torrents.csv/Dockerfile

42 lines
1.3 KiB
Docker
Raw Normal View History

2018-12-03 05:19:03 +00:00
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
2019-04-10 04:45:21 +00:00
WORKDIR /app/server/ui
RUN yarn
RUN yarn build
2018-12-01 00:14:02 +00:00
2019-06-26 04:09:06 +00:00
FROM rust:latest as rust
2019-04-10 22:48:23 +00:00
WORKDIR /app/server
# cache the build
RUN USER=root cargo new service
2019-04-10 04:29:13 +00:00
WORKDIR /app/server/service
2019-04-10 22:48:23 +00:00
# copy over your manifests
COPY server/service/Cargo.toml server/service/Cargo.lock ./
RUN cargo build --release
RUN rm src/*.rs
COPY server/service/src ./src
RUN rm -r ./target/release/.fingerprint/torrents-csv-*
2019-04-10 04:45:21 +00:00
RUN cargo build --release
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
FROM debian:jessie-slim as volume
COPY torrents.csv /db/
2019-06-25 23:33:12 +00:00
COPY torrent_files.csv /db/
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
FROM debian:jessie-slim
2019-03-18 19:31:32 +00:00
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
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
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/
2019-06-25 23:33:12 +00:00
COPY --from=volume /db/torrent_files.csv /app/
2018-12-03 05:19:03 +00:00
COPY scripts /app/scripts
2019-03-18 19:31:32 +00:00
WORKDIR /app/scripts/
2019-05-05 17:59:56 +00:00
RUN ["/bin/bash", "./build_sqlite.sh"]
2018-12-03 05:19:03 +00:00
EXPOSE 8080
WORKDIR /app/