Skip to content

Category: Docker

traefik v3 example with uptime-kuma

Here is an example of Traefik, using Uptime-Kuma as an example with a domain for it plus using letsencrypt to secure the domain. We also redirect HTTP to HTTPS.

The Traefik dashboard is not secure, so please implement security or a firewall.

This is just an example.

version: "3"

services:
 uk1:
    image: louislam/uptime-kuma:1
    container_name: uk1
    volumes:
      - ./uk1-data:/app/data
    ports:
      - 3001:3001  # <Host Port>:<Container Port>
    restart: always
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.uk1.tls.certresolver=myresolver"
      - "traefik.http.routers.uk1-http.entrypoints=web"
      - "traefik.http.routers.uk1-http.rule=Host(`your_domain_here`)"
      - "traefik.http.routers.uk1-http.middlewares=uk1-https"
      - "traefik.http.middlewares.uk1-https.redirectscheme.scheme=https"
      - "traefik.http.routers.uk1.entrypoints=websecure"
      - "traefik.http.routers.uk1.rule=Host(`your_domain_here`)"
      - "traefik.http.routers.uk1.tls=true"
    depends_on:
      - traefik
 traefik:
  image: traefik:v3.0
  command:
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.myresolver.acme.httpchallenge=true"
      - "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
      - "--certificatesresolvers.myresolver.acme.email=your_email_address_here"
      - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
  ports:
    - 80:80
    - 443:443
    - 8080:8080
  volumes:
    - "./letsencrypt:/letsencrypt"
    - /var/run/docker.sock:/var/run/docker.sock

https://gist.github.com/xavier-hernandez/48042d5cdb66a89ac5e92a92ecfeb7b5

Leave a Comment

tls: failed to verify certificate: x509: certificate signed by unknown authority

In building a docker image for a Go application using the Apline image, I kept getting this error “tls: failed to verify certificate: x509: certificate signed by unknown authority”. I thought it was something with the code I was writing, but it had to do with the docker image.

Adding this to your Dockerfile should fix the problem. The problem is that the docker container doesn’t have the necessary certs to validate the connection. You might also get around this issue by adding the “ca-certificates” package to the image, but I didn’t try that.

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

or (depends on how your building your image)

COPY /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Leave a Comment

Spanish Wordle / Wordle Espanol

Cloned a Worlde repository and populated it with a Spanish wordlist.

https://wordle-es.xavier.cc/

Docker Image: https://hub.docker.com/r/xavierh/wordle-spanish-espanol

Leave a Comment

Setting up Rocket.Chat with Mongo 4.2 via Docker

I could not find a docker-compose.yml example with rocket.chat using 4.2 so I pieced one together.

Also, some tips on these errors.

Error: $MONGO_OPLOG_URL must be set to the ‘local’ database of a Mongo replica set

MongoError: not master and slaveOk=false

Visit my Github repo for more information: https://github.com/xavier-hernandez/rocket.chat/

Leave a Comment