Getting Error Trying to Deploy with Redis on Docker

I have a local Docker machine with just a SQLite database and redis enabled. It works fine locally.

I made a new target with type Docker and connected it to a cloud server on DigitalOcean.
Set the database to a MySQL server from a DigitalOcean database cluster.

When I try to deploy to my live server I get

service “redis” refers to undefined network proxy: invalid compose project
Error Launching Services!

Am I doing something wrong or does Redis not work with the setup I have?

@George

service “redis” refers to undefined network proxy: invalid compose project

@Eric_F
I believe there were some changes made to Docker deployments in the latest Wappler update, I’ve moved this topic to bug reports

1 Like

Have you also installed Traefik on the server or just Redis?

Haven’t installed Traefik or anything else. Made the server and database in resource manager, created a target using those, and tried to deploy.

Could you try to reapply the target settings by just opening and saving the project settings? And then deploy see if it makes any difference

Still not working. I also just tried turning off redis in the settings for the live target and deploying but I still got the redis error even with it turned off.

Are you sure you are on the right target? Have you made it active target?

Because if you remove Redis there shouldn’t be any Redis errors.

Here I try to deploy with Redis and then disable it and try again. Same error each time.

Tried making a new server on DigitalOcean via resource manager, set it as a target, set no database at all and redis was off, still got the error.

service “redis” refers to undefined network proxy: invalid compose project
Error Launching Services!

@Teodor could you maybe help me with this while George is away?

Asked ChatGPT and it said my Docker compose could be the problem.

This is what it was

services:
  web:
    ports:
      - '80:3000'
    restart: 'always'
    stdin_open: true
    tty: true
    logging:
      options:
        max-file: '5'
        max-size: '10m'
    build:
      context: '../../../'
      dockerfile: '.wappler/targets/LIVE/web/Dockerfile'
    volumes:
      - 'user_uploads:/opt/node_app/public/assets/uploads:rw'
  redis:
    image: 'redis:alpine'
    hostname: 'redis'
    networks:
      proxy: ~
    volumes:
      - 'redis-volume:/data'
volumes:
  redis-volume: ~
  user_uploads: ~

ChatGPT said the networks section was incomplete and recommended the following

version: '3'
services:
  web:
    ports:
      - '80:3000'
    restart: 'always'
    stdin_open: true
    tty: true
    logging:
      options:
        max-file: '5'
        max-size: '10m'
    build:
      context: '../../../'
      dockerfile: '.wappler/targets/LIVE/web/Dockerfile'
    volumes:
      - 'user_uploads:/opt/node_app/public/assets/uploads:rw'
    networks:
      - my-network

  redis:
    image: 'redis:alpine'
    hostname: 'redis'
    volumes:
      - 'redis-volume:/data'
    networks:
      - my-network

volumes:
  redis-volume: ~
  user_uploads: ~

networks:
  my-network:

I tried it and it seems to work, wondering if someone who knows about Docker more could confirm it is a valid fix. Also want to make sure Wappler won’t overwrite the changes or anything like that. Or if there is something in Wappler I need to change rather than edit the file?

@Apple sorry to bother you but I know you know about this stuff and was hoping you could take a quick look.

Hi Eric,

The fix you applied is not a valid fix - Traefik wouldn’t be able to access your web service as it’s not on the same network as Traefik. The correct would be (as copied from an existing docker-compose of a Wappler project):

networks:
  proxy:
    name: 'wappler-compose_proxy'
    external: true

Would I change that under networks at the very bottom and then change the
networks: -my network
under both redis and web to be wappler-compose_proxy ?

I also earlier tried deleting the docker compose file and let Wappler make a new one but still had the problem. I made a new project and it let me publish with redis on, so it makes me think I have a problem somewhere in my project. But I don’t even know how I would have changed any network settings.

Yes, actually “wappler-compose_proxy” is aliased to “proxy”, so in networks you’d just use “proxy”, e.g.:

web:
  networks:
    proxy: ~

Though as you don’t have Traefik installed, the “wappler-compose_proxy” might not exist in first place, so you’d still get an error

Unfortunately, I’m not inside into the specifics of the way Wappler generates docker-compose files, so Teodor would probably the best person to take a look at this while George is away

1 Like

Finally got this figured out! Your comment on not having Traefik installed pointed me in the right direction.

I set this project up on Digital Ocean initially and installed Traefik, then I messed around with hosting on Railway but decided to switch back to Digital Ocean to use Redis. The original settings for Traefik and Portainer were still enabled. I thought I deleted them, but they got added back or can’t be removed from the Wappler project or something.

So rather than just upload to the Digital Ocean IP I went ahead and setup the domain with Traefik and it is all online and Redis says it upload fine.

1 Like