Skip to content

Commit

Permalink
fixed dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
0xluk committed Sep 4, 2024
1 parent b7a7247 commit aa62676
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ WORKDIR /src
COPY . /src

RUN go mod tidy
RUN go build -o "/src/bin/go-node-proxy"
WORKDIR /src/app/go-node-proxy
RUN go build

# We don't need golang to run binaries, just use alpine.
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y ca-certificates
COPY --from=builder /src/bin/go-node-proxy /app/go-node-proxy
COPY --from=builder /src/app/go-node-proxy /app/go-node-proxy
RUN chmod +x /app/go-node-proxy

EXPOSE 8000
Expand Down
51 changes: 51 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
services:
# Archiver node services
qubic-node-proxy:
image: ghcr.io/qubic/qubic-node-proxy:v0.1.0
container_name: qubic-node-proxy
labels:
# Traefik
- "traefik.enable=true"
## Router
- "traefik.http.routers.qubic-node-proxy.entrypoints=web"
- "traefik.http.routers.qubic-node-proxy.rule=(PathPrefix(`/v1`))"
## Middlewares
- "traefik.http.middlewares.cors.headers.accesscontrolallowmethods=*"
- "traefik.http.middlewares.cors.headers.accesscontrolalloworiginlist=*"
- "traefik.http.middlewares.cors.headers.accesscontrolmaxage=300"
- "traefik.http.middlewares.cors.headers.addvaryheader=true"
## Services
- "traefik.http.services.qubic-node-proxy.loadbalancer.server.port=8000"
environment:
QUBIC_NODE_PROXY_POOL_NODE_FETCHER_URL: "http://213.170.135.5:8080/status"
ports:
- "127.0.0.1:8000:8000"
- "0.0.0.0:8001:8001"
networks:
- qubic
depends_on:
qubic-nodes:
condition: service_healthy
restart: always
traefik:
image: traefik:v2.5
container_name: traefik
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--metrics.prometheus=true"
- "--metrics.prometheus.buckets=0.1,0.3,1.2,5.0"
- "--providers.docker=true"
- "--providers.docker.watch"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- qubic
restart: always

networks:
qubic:

0 comments on commit aa62676

Please sign in to comment.