Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose file #6

Closed
itschip opened this issue Apr 30, 2024 · 8 comments
Closed

Docker compose file #6

itschip opened this issue Apr 30, 2024 · 8 comments

Comments

@itschip
Copy link
Contributor

itschip commented Apr 30, 2024

Seeing as there are some requirements to running this locally that requires installation of, ex. redis, a docker-compose file would be great to bootstrap the dev env.

I can take a go at it if you're not already working on it.

@Rei-x
Copy link
Contributor

Rei-x commented Apr 30, 2024

this is an example docker compose that i'm using for dev

services:
  postgres:
    image: postgres:latest
    environment:
      POSTGRES_DB: dokploy
      POSTGRES_USER: dokploy
      POSTGRES_PASSWORD: amukds4wi9001583845717ad2
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"

  redis:
    image: redis:latest
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data

volumes:
  postgres_data:
  redis_data:

@itschip
Copy link
Contributor Author

itschip commented Apr 30, 2024

@Rei-x sweet! Perhaps @Siumauricio is open for a PR of it

@Siumauricio
Copy link
Contributor

Siumauricio commented Apr 30, 2024

Thank your for the interest.

  • When you run pnpm run dev it automatically in the /server/server.ts you can see spin up the traefik, postgres and redis, https://github.com/Dokploy/dokploy/blob/main/server/server.ts#L43, if you run in to some issues just give a few seconds and then restart the server and don't forget the run the migrations (only move the migrate funtion to above that will execute the migrations automatically)

But i guess is not intuitive to have like that, so let's merge the @itschip Pr's

@itschip
Copy link
Contributor Author

itschip commented Apr 30, 2024

@Siumauricio Hey and thanks for the clarification of this. I totally missed it. I only saw a bunch of errors. If this is the desired way of doing it, perhaps have a script that runs before the actual next dev command which sets up the docker networ? As it's now spamming with errors and then you see "Redis started" after some time.

@Siumauricio
Copy link
Contributor

Siumauricio commented Apr 30, 2024

@itschip Yeah, they initially throw errors, because if you don't have the images and services up it will automatically download, and then starts the services when you already have downloaded, I think this is something we can improve is not intuitive, only for me maybe when i was doing this lol, regarding to the network they should create the network automatically, in the case if the network is not created run this command docker network create --driver overlay --attachable dokploy-network

https://github.com/Dokploy/dokploy/blob/main/server/setup/setup.ts#L27

@itschip
Copy link
Contributor Author

itschip commented Apr 30, 2024

I'm just noting it here @Siumauricio as it might not be easy to catch. pnpm dev currently creates a swarm, but doesnt leave the swarm when stopping the application, so whenever you try to delete containers - it will keep recreating them.

Might not be intended in a dev env :D just noticed it now that it keeps on creating a bunch of them.
Screenshot 2024-04-30 at 18 08 22

@Siumauricio
Copy link
Contributor

I updated the instructions here, check the new CONTRIBUTING FILE https://github.com/Dokploy/dokploy/blob/4c2bfb95e32e90130160971615c1a07f4b0c6fdc/CONTRIBUTING.md#setup

PR: #13

@Siumauricio
Copy link
Contributor

Changes are on canary branch, let me know if something goes wrong, Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants