torrents.csv/Dockerfile

39 lines
1.0 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'
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
ENV TORRENTS_CSV_ENDPOINT=http://0.0.0.0:8080
COPY server/ui /app/server/ui
RUN cd /app/server/ui && yarn && yarn build
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
FROM rust:1.30 as rust
COPY server/service /app/server/service
RUN cd /app/server/service && cargo build --release && cp ./target/release/torrents-csv-service .
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
FROM debian:jessie-slim as volume
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
COPY torrents.csv /db/
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
FROM debian:jessie-slim
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
RUN apt update && apt install -y sqlite3
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/
COPY scripts /app/scripts
RUN cd /app/scripts && . ./build_sqlite.sh
2018-12-01 00:14:02 +00:00
2018-12-03 05:19:03 +00:00
EXPOSE 8080
WORKDIR /app/
ENV TORRENTS_CSV_DB_FILE=/app/torrents.db
ENV TORRENTS_CSV_FRONT_END_DIR=/app/dist
RUN sqlite3 ${TORRENTS_CSV_DB_FILE} 'select * from torrents limit 10'
CMD /app/torrents-csv-service
# Running this:
# docker build .
# docker run -p 8080:8080 image_name