hotosm / tasking-manager

Tasking Manager - The tool to team up for mapping in OpenStreetMap
https://wiki.openstreetmap.org/wiki/Tasking_Manager
BSD 2-Clause "Simplified" License
505 stars 270 forks source link

Avoid bind-mounting code on non-dev setups #3633

Open frafra opened 3 years ago

frafra commented 3 years ago

https://github.com/hotosm/tasking-manager/blob/d94ea226e2142da7e2b4b33755ab12ce41797458/docker-compose.override.yml#L13-L14

The documentation says to use docker-compose up to deploy, but that means to bind mount local code directories on non-development setups, which is counterintuitive (doing a git pull on master would change the code without having rebuilt any image).

I would suggest keeping a different compose file for development images, which do not include code, but it fetches it by mounting the directories.

The logs directory could be mounted on a specific volume (or - even better - avoided entirely by printing errors on stderr #3636).

frafra commented 3 years ago

If the idea is to use docker-compose.override.yml for development, I would suggest moving the build sections into the main compose file, which cannot be used without the override file at the moment (because images cannot be pulled).

ramyaragupathy commented 5 months ago

@spwoodcock thoughts here?

spwoodcock commented 5 months ago

Completely agree that bind mounts should not be used in production.

As of 2024, we are using AWS for production. The docker compose config is only used for local development.

You can close this issue 👍

frafra commented 5 months ago

So is the compose file going to be discouraged/discontinued for production entirely? What is the suggested alternative? Is AWS going to be the suggested platform for deploying HOT? With or without containers?

spwoodcock commented 5 months ago

Hey @frafra, sorry maybe I didn't have enough context to make that call! 😅

I was under the impression that the docker compose config was only used for development, but if people actively use it for production deployments then that's a different story.

AWS is definitely not a 'suggested platform' - we don't want to rely on cloud providers, and at a bare minimum have a cloud agnostic solution. We just happen to use AWS for now.

I would say that the container based deployment is the recommended approach for deployment though 👍

@ramyaragupathy perhaps we need a production docker compose config so that the community can easily deploy TM, and a separate developer-facing docker compose setup only for development?

frafra commented 5 months ago

Indeed, there are some instances in production :)

ramyaragupathy commented 5 months ago

perhaps we need a production docker compose config so that the community can easily deploy TM, and a separate developer-facing docker compose setup only for development?

@spwoodcock @frafra - we have been pushing the docker setup only for development environment.

@frafra - do you know of instances relying on the docker production setup? May be talking to them can help us polish this further @eternaltyro @dakotabenjamin

frafra commented 5 months ago

@ramyaragupathy WikiMedia Italia/OpenStreetMap Italia uses https://osmit-estratti.wmcloud.org/. I am one of the people who helped set it up and maintain it :-)