2023-06-05 09:59:49 -05:00
# Docker
2023-12-05 09:18:10 -06:00
An official uMap docker image is [available on the docker hub ](https://hub.docker.com/r/umap/umap ). But, if you prefer to run it with docker compose, here is the configuration file:
2023-11-28 08:54:11 -06:00
```yaml title="docker-compose.yml"
2023-06-05 09:59:49 -05:00
version: '3'
services:
db:
2023-09-19 12:24:32 -05:00
# check https://hub.docker.com/r/postgis/postgis to see available versions
image: postgis/postgis:14-3.4-alpine
2023-06-05 09:59:49 -05:00
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
2023-09-19 12:24:32 -05:00
- umap_db:/var/lib/postgresql/data
2023-06-05 09:59:49 -05:00
app:
2023-09-19 12:24:32 -05:00
# Check https://hub.docker.com/r/umap/umap/tags to find the latest version
2024-02-19 16:46:13 -06:00
image: umap/umap:2.0.2
2023-06-05 09:59:49 -05:00
ports:
2023-09-19 12:24:32 -05:00
# modify the external port (8001, on the left) if desired, but make sure it matches SITE_URL, below
2023-06-05 09:59:49 -05:00
- "8001:8000"
environment:
- DATABASE_URL=postgis://postgres@db/postgres
2023-09-19 12:24:32 -05:00
- SITE_URL=https://localhost:8001/
- STATIC_ROOT=/srv/umap/static
- MEDIA_ROOT=/srv/umap/uploads
2023-06-05 09:59:49 -05:00
volumes:
2023-09-19 12:24:32 -05:00
- umap_userdata:/srv/umap/uploads
# FIX the path on the left, below, to your location
- /home/ubuntu/umap.conf:/etc/umap/umap.conf
restart: always
depends_on:
- db
2023-06-05 09:59:49 -05:00
volumes:
2023-09-19 12:24:32 -05:00
umap_userdata:
umap_db:
2024-02-19 16:46:13 -06:00
```
Note that you’ ll have to set a [`SECRET_KEY` ](https://docs.djangoproject.com/en/5.0/ref/settings/#secret-key ) environment variable that must be secret and unique. One way to generate it is through the `secrets` module from Python:
```sh
$ python3 -c 'import secrets; print(secrets.token_hex(100))'
```