Fixing up docker a little bit. #19.

This commit is contained in:
Dessalines 2018-12-10 12:15:46 -07:00
parent c3b8a98b77
commit 6e45419e67
2 changed files with 12 additions and 14 deletions

View File

@ -1,13 +1,13 @@
FROM node:10-jessie as node
#If encounter Invalid cross-device error -run on host 'echo N | sudo tee /sys/module/overlay/parameters/metacopy'
ARG TORRENTS_CSV_ENDPOINT
ENV TORRENTS_CSV_ENDPOINT=http://0.0.0.0:8080
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 && cp ./target/release/torrents-csv-service .
RUN cd /app/server/service && cargo build --release
FROM debian:jessie-slim as volume
@ -25,15 +25,7 @@ RUN cd /app/scripts && . ./build_sqlite.sh
EXPOSE 8080
WORKDIR /app/
ENV TORRENTS_CSV_DB_FILE=/app/torrents.db
ENV TORRENTS_CSV_FRONT_END_DIR=/app/dist
ARG TORRENTS_CSV_DB_FILE
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

View File

@ -1,8 +1,14 @@
version: '2'
version: '3'
services:
torrents-csv:
build: .
build:
context: .
args:
TORRENTS_CSV_ENDPOINT: http://0.0.0.0:8080
command: /bin/sh -c /app/torrents-csv-service
ports:
- "8080:8080"
environment:
TORRENTS_CSV_DB_FILE: /app/torrents.db
TORRENTS_CSV_FRONT_END_DIR: /app/dist