From 6e45419e676cefffc0688649676cfa2b96c83451 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 10 Dec 2018 12:15:46 -0700 Subject: [PATCH] Fixing up docker a little bit. #19. --- Dockerfile | 14 +++----------- docker-compose.yml | 12 +++++++++--- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 471aebc..32c1b88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ff6cef5..d445ebe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" \ No newline at end of file + - "8080:8080" + environment: + TORRENTS_CSV_DB_FILE: /app/torrents.db + TORRENTS_CSV_FRONT_END_DIR: /app/dist \ No newline at end of file