From 308a0b59e49b3c52bd6c901e78158506b0de0f65 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Fri, 3 Jul 2020 01:32:18 -0700 Subject: [PATCH] adding the docker bits to get ready to serve it for real --- .dockerignore | 1 + .gitignore | 3 +++ Dockerfile | 22 ++++++++++++++++++++++ docker-compose.example.yml | 10 ++++++++++ docker-compose.yml | 23 +++++++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.example.yml create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2f7896d --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +target/ diff --git a/.gitignore b/.gitignore index ea8c4bf..2a39827 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ /target +docker-compose.prod.yml +docker-compose.stage.yml +docker-compose.dev.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..586d474 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:19.10 + +RUN apt-get update && apt-get install -y build-essential + +RUN apt-get install -y curl git + +RUN useradd -m -d /home/wownero-explorer wownero-explorer + +RUN mkdir -p /srv && chown -R wownero-explorer:wownero-explorer /srv + +USER wownero-explorer +WORKDIR /srv + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | RUSTUP_HOME=/home/wownero-explorer/.rustup sh -s -- -y +RUN git clone https://git.wownero.com/lza_menace/wownero-explorer && \ + cd wownero-explorer && \ + ~/.cargo/bin/rustup override set nightly && \ + ~/.cargo/bin/cargo build --release + +WORKDIR /srv/wownero-explorer + +CMD './target/release/wownero-explorer' diff --git a/docker-compose.example.yml b/docker-compose.example.yml new file mode 100644 index 0000000..0a7ebb8 --- /dev/null +++ b/docker-compose.example.yml @@ -0,0 +1,10 @@ +version: '3' +services: + wownero-explorer: + build: + context: . + dockerfile: Dockerfile + labels: + - "traefik.http.routers.whoami.rule=Host(``)" + environment: + DAEMON_URI: ${DAEMON_URI} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..707cd1e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3' +services: + reverse-proxy: + image: traefik:v2.2 + command: --api.insecure=true --providers.docker + ports: + # The HTTP port + - "8080:80" + # The Web UI (enabled by --api.insecure=true) + - "9000:8080" + volumes: + # So that Traefik can listen to the Docker events + - /var/run/docker.sock:/var/run/docker.sock + wownero-explorer: + build: + context: . + dockerfile: Dockerfile + labels: + - "traefik.http.routers.explorer.rule=Host(`localhost:8000`)" + environment: + DAEMON_URI: ${DAEMON_URI} + ports: + - "8000:8000"