Skip to content

Commit 473dd74

Browse files
weiji14geohacker
andauthored
Add titiler service (#26)
* Move titiler config to deploy/vbos/docker-compose.yml Also change port mapping from 8002:8000 to 8000:80. * Update README.md docs Update some docker commands, link to docker engine and compose install pages, update status badge. * Add titiler to docker compose up command * add caddy labels, port to titiler * use titiler command. fix port * put back titiler in default local docker-compose --------- Co-authored-by: geohacker <[email protected]>
1 parent 2c0d8f2 commit 473dd74

File tree

3 files changed

+36
-7
lines changed

3 files changed

+36
-7
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,28 @@
11
# vbos-backend
22

3-
[![Build Status](https://travis-ci.org/developmentseed/vbos-backend.svg?branch=master)](https://travis-ci.org/developmentseed/vbos-backend)
3+
[![Docker](https://github.com/developmentseed/vbos-backend/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/developmentseed/vbos-backend/actions/workflows/docker-publish.yml)
44
[![Built with](https://img.shields.io/badge/Built_with-Cookiecutter_Django_Rest-F7B633.svg)](https://github.com/agconti/cookiecutter-django-rest)
55

66
VBOS Django application and data services. Check out the project's [documentation](http://developmentseed.github.io/vbos-backend/).
77

88
# Prerequisites
99

10-
- [Docker](https://docs.docker.com/docker-for-mac/install/)
10+
- [Docker Engine](https://docs.docker.com/engine/install)
11+
- [Docker Compose](https://docs.docker.com/compose/install)
1112

1213
# Local Development
1314

1415
Start the dev server for local development:
16+
1517
```bash
16-
docker-compose up
18+
cd deploy/
19+
docker compose up
1720
```
1821

1922
Run a command inside the docker container:
2023

2124
```bash
22-
docker-compose run --rm web [command]
25+
docker compose run --rm web [command]
2326
```
2427

2528
# Configuration

deploy/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ All deploy related configuration are in the `deploy/` directory.
88

99
To update or redeploy:
1010
1. First ssh into the server. Keys are in 1PW
11-
2. Fetch code and run migrations.
11+
2. Fetch code and run migrations.
1212
* Activate venv. `. ~/vbos-env/bin/activate`
13-
* `cd vbos-backend && git pull`. `python manage.py migrate`
13+
* `cd ~/vbos-backend && git pull`. `python manage.py migrate`
1414
3. Then run `docker compose -f deploy/vbos/docker-compose.yml pull` to pull the new image. By default the image tag is `main`
15-
4. Then run `docker compose -f deploy/vbos/docker-compose.yml --env-file /home/devseed/vbos-backend/.env up --force-recreate -d --no-deps vbos-backend` — this will start a new container and kill the older one for deploys with no downtime
15+
4. Then run `docker compose -f deploy/vbos/docker-compose.yml --env-file /home/devseed/vbos-backend/.env up --force-recreate -d --no-deps vbos-backend titiler` — this will start a new container and kill the older one for deploys with no downtime

deploy/vbos/docker-compose.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,32 @@ services:
3131
caddy.handle: "/static/*"
3232
caddy.handle.root: "* /www/html"
3333
caddy.handle.file_server:
34+
titiler:
35+
image: ghcr.io/developmentseed/titiler:latest
36+
container_name: titiler
37+
platform: linux/amd64
38+
environment:
39+
CPL_TMPDIR: /tmp
40+
GDAL_CACHEMAX: 75%
41+
VSI_CACHE: TRUE
42+
VSI_CACHE_SIZE: 1073741824
43+
GDAL_DISABLE_READDIR_ON_OPEN: EMPTY_DIR
44+
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: YES
45+
GDAL_HTTP_MULTIPLEX: YES
46+
GDAL_HTTP_VERSION: 2
47+
PYTHONWARNINGS: ignore
48+
WEB_CONCURRENCY: 4
49+
command: ["uvicorn", "titiler.application.main:app", "--host", "0.0.0.0", "--port", "8001", "--workers", "1"]
50+
ports:
51+
- "8001:8001"
52+
volumes:
53+
- ./data:/data # Optional: mount local directory with your raster files
54+
restart: unless-stopped
55+
networks:
56+
- caddy
57+
labels:
58+
caddy: vbos-titiler.ds.io
59+
caddy.reverse_proxy: "{{upstreams 8001}}"
3460

3561
networks:
3662
caddy:

0 commit comments

Comments
 (0)