Browse Source

adding the docker bits to get ready to serve it for real

master
lza_menace 3 months ago
parent
commit
308a0b59e4
5 changed files with 59 additions and 0 deletions
  1. +1
    -0
      .dockerignore
  2. +3
    -0
      .gitignore
  3. +22
    -0
      Dockerfile
  4. +10
    -0
      docker-compose.example.yml
  5. +23
    -0
      docker-compose.yml

+ 1
- 0
.dockerignore View File

@ -0,0 +1 @@
target/

+ 3
- 0
.gitignore View File

@ -1 +1,4 @@
/target
docker-compose.prod.yml
docker-compose.stage.yml
docker-compose.dev.yml

+ 22
- 0
Dockerfile View File

@ -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'

+ 10
- 0
docker-compose.example.yml View File

@ -0,0 +1,10 @@
version: '3'
services:
wownero-explorer:
build:
context: .
dockerfile: Dockerfile
labels:
- "traefik.http.routers.whoami.rule=Host(`<external dns name>`)"
environment:
DAEMON_URI: ${DAEMON_URI}

+ 23
- 0
docker-compose.yml View File

@ -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"

Loading…
Cancel
Save