Installing squidex inside windows wsl2 docker

Has anyone managed to install squidex inside local wsl2 docker container?
I tried both nginx and noproxy yml and get either Bad Gateway or Invalid redirect_uri errors.
I used localhost and local host name with ip pointed to wsl2 in my hosts file, but it did not work. I would appreciate any guidance on this.

The nginx version does not work I think because it also requires a domain to setup a dev certificate. The newer caddy version might work.

The invalid redirect_uri is the same problem: You need a certificate to run Squidex.

You can try this compose file i am not sure if that work (it is some time when i make my setup). But it shouldn’t required any extra config file. Only add squidex.local to C:\Windows\System32\drivers\etc

127.0.0.1 squidex.local

Compose file

version: '3.3'

services:

  squidex_traefik:
    image: traefik:v2.4.7
    command: 
      - --api=true
      - --api.dashboard=true
      - --api.debug=true
      - --api.insecure=true
      - --providers.docker=true
      - --providers.docker.exposedbydefault=false
      - --entryPoints.web.address=:80
      - --entryPoints.web-secure.address=:443
      - --entryPoints.traefik.address=:8080
      - --entryPoints.mongo.address=:27017
      - --entryPoints.web.forwardedHeaders.insecure
      - --accessLog=true
      - --log=true
      - --log.level=INFO
    ports:
      - 10080:80
      - 10443:443
      - 10030:8080
      - 27017:27017
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    restart: always
    labels:
      traefik.enable: 'true'
      traefik.http.routers.api.entryPoints: traefik
      traefik.http.routers.traefikRouter.rule: Host(`traefik.squidex.local`)
      treafik.http.routers.traefikRouter.service: api@internal
      traefik.http.routers.traefikRouter.entrypoints: web-secure
      #..
      traefik.http.services.traefik.loadbalancer.server.port: 8080
      # global redirect to https
      traefik.http.routers.http-catchall.rule: hostregexp(`{host:.+}`)
      traefik.http.routers.http-catchall.entrypoints: web
      traefik.http.routers.http-catchall.middlewares: redirect-to-https
      # middleware redirect
      traefik.http.middlewares.redirect-to-https.redirectscheme.scheme: https
    networks:
      - internal
      - squidex

  squidex_mongo:
    image: mongo:latest
    restart: always
    volumes:
      - mongo-db:/data/db
    expose:
      - "27017"
    ports:
      - 27099:27017
    networks:
      - internal
    labels:
      traefik.enable: 'true'
      traefik.tcp.routers.squidexMongoRouter.entrypoints: mongo
      traefik.tcp.routers.squidexMongoRouter.service: mongo
      traefik.tcp.routers.squidexMongoRouter.rule: HostSNI(`mongo.squidex.local`)
      traefik.tcp.services.mongo.loadbalancer.server.port: '27017'

  squidex_squidex:
    image: "squidex/squidex:5.7.1"
    environment:
      - URLS__BASEURL=https://squidex.local:10443/
      - URLS__ENFORCEHTTPS=false # it should be handle by reverse proxy (also it enable use squidex directly from other container)
      - EVENTSTORE__MONGODB__CONFIGURATION=mongodb://squidex_mongo
      - STORE__MONGODB__CONFIGURATION=mongodb://squidex_mongo
      - ASSETSTORE__MONGODB__DATABASE=SquidexAssets
      - ASSETSTORE__MONGODB__CONFIGURATION=mongodb://squidex_mongo
      - ASSETSTORE__MONGODB__BUCKET=fs
      - ASSETSTORE__TYPE=mongoDb
      - IDENTITY__ADMINEMAIL=your@email.com
      - IDENTITY__ADMINPASSWORD=FILLADMINPASS!!<--
      - VIRTUAL_HOST=squidex.local
      - ASSETS__MAXSIZE=104857600
      - REBUILD__ASSETFILES=true
      - REBUILD__ASSETS=true
      - REBUILD__APPS=true
      - REBUILD__CONTENTS=true
      - REBUILD__RULES=true
      - REBUILD__SCHEMAS=true
    depends_on:
      - squidex_mongo
    volumes:
      - /squidex/assets:/app/Assets
    networks:
      - internal
    restart: always
    labels:
      traefik.enable: 'true'
      traefik.http.routers.squidexRouter.rule: Host(`squidex.local`)
      traefik.http.routers.squidexRouter.entrypoints: web-secure
      traefik.http.routers.squidexRouter.tls: 'true'
      traefik.http.routers.squidexRouter2.rule: Host(`localhost`)
      traefik.http.routers.squidexRouter2.entrypoints: web-secure
      traefik.http.routers.squidexRouter2.tls: 'true'
      traefik.http.routers.squidexRouter3.rule: Host(`127.0.0.1`)
      traefik.http.routers.squidexRouter3.entrypoints: web-secure
      traefik.http.routers.squidexRouter3.tls: 'true'
      traefik.http.services.squidex.loadbalancer.server.port: '80'

volumes:
  mongo-db:
networks:
  internal:
  squidex:

Please just provide me the logs, I do not have the time to dig into all deployment options. I have never used traefik before.

sorry i do not have problem with local squidex instance i just want to help with putting docker compose file what i have saved when i try it (at that time squidex caddy version was not publish on github). If my post is confusing just remove it :slight_smile:

Okay, sorry. Then: Thank you very much :slight_smile:

1 Like