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

Use latest Docker keyword for docker-compose #2043

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ minor: ## Bump the current version to a new minor one
docker: ## Create a new Docker image and publish it
$(eval VERSION=$(shell hatch version))
@echo "Version to build: ${VERSION}"
docker build -t umap/umap:${VERSION} .
docker push umap/umap:${VERSION}
docker build -t umap/umap:${VERSION} -t umap/umap:latest .
docker push --all-tags umap/umap:${VERSION}

.PHONY: build
build: ## Build the Python package before release
Expand Down
18 changes: 13 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ services:
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 2s
# check https://hub.docker.com/r/postgis/postgis to see available versions
image: postgis/postgis:14-3.3-alpine
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
Expand All @@ -16,18 +17,25 @@ services:
depends_on:
db:
condition: service_healthy
image: umap/umap:2.0.2
image: umap/umap:latest
ports:
- "${PORT-8000}:8000"
# modify the external port (8001, on the left) if desired, but make sure it matches SITE_URL, below
- "8001:8000"
environment:
- DATABASE_URL=postgis://postgres@db/postgres
- SECRET_KEY=some-long-and-weirdly-unrandom-secret-key
- SITE_URL=https://umap.local/
- SITE_URL=https://localhost:8001/
- UMAP_ALLOW_ANONYMOUS=True
- DEBUG=1
- STATIC_ROOT=/srv/umap/static
- MEDIA_ROOT=/srv/umap/uploads
volumes:
- data:/srv/umap/uploads
- umap_userdata:/srv/umap/uploads
# FIX the path on the left, below, to your location
# OPTIONAL, you can comment the line below out for default
# values to apply
- /home/ubuntu/umap.conf:/etc/umap/umap.conf

volumes:
data:
umap_userdata:
db:
35 changes: 1 addition & 34 deletions docs/deploy/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,7 @@
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:

```yaml title="docker-compose.yml"
version: '3'
services:
db:
# check https://hub.docker.com/r/postgis/postgis to see available versions
image: postgis/postgis:14-3.4-alpine
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- umap_db:/var/lib/postgresql/data

app:
# Check https://hub.docker.com/r/umap/umap/tags to find the latest version
image: umap/umap:2.0.2
ports:
# modify the external port (8001, on the left) if desired, but make sure it matches SITE_URL, below
- "8001:8000"
environment:
- DATABASE_URL=postgis://postgres@db/postgres
- SITE_URL=https://localhost:8001/
- STATIC_ROOT=/srv/umap/static
- MEDIA_ROOT=/srv/umap/uploads
volumes:
- umap_userdata:/srv/umap/uploads
# FIX the path on the left, below, to your location
# OPTIONAL, you can comment the line below out for default
# values to apply
- /home/ubuntu/umap.conf:/etc/umap/umap.conf
restart: always
depends_on:
- db

volumes:
umap_userdata:
umap_db:
--8<-- "./docker-compose.yml"
```

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:
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
combine_header_slug: true
- pymdownx.snippets
Loading