Skip to content
Merged
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
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
# vbos-backend

[![Build Status](https://travis-ci.org/developmentseed/vbos-backend.svg?branch=master)](https://travis-ci.org/developmentseed/vbos-backend)
[![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)
[![Built with](https://img.shields.io/badge/Built_with-Cookiecutter_Django_Rest-F7B633.svg)](https://github.com/agconti/cookiecutter-django-rest)

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

# Prerequisites

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

# Local Development

Start the dev server for local development:

```bash
docker-compose up
cd deploy/
docker compose up
```

Run a command inside the docker container:

```bash
docker-compose run --rm web [command]
docker compose run --rm web [command]
```

# Configuration
Expand Down
6 changes: 3 additions & 3 deletions deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ All deploy related configuration are in the `deploy/` directory.

To update or redeploy:
1. First ssh into the server. Keys are in 1PW
2. Fetch code and run migrations.
2. Fetch code and run migrations.
* Activate venv. `. ~/vbos-env/bin/activate`
* `cd vbos-backend && git pull`. `python manage.py migrate`
* `cd ~/vbos-backend && git pull`. `python manage.py migrate`
3. Then run `docker compose -f deploy/vbos/docker-compose.yml pull` to pull the new image. By default the image tag is `main`
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
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
26 changes: 26 additions & 0 deletions deploy/vbos/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,32 @@ services:
caddy.handle: "/static/*"
caddy.handle.root: "* /www/html"
caddy.handle.file_server:
titiler:
image: ghcr.io/developmentseed/titiler:latest
container_name: titiler
platform: linux/amd64
environment:
CPL_TMPDIR: /tmp
GDAL_CACHEMAX: 75%
VSI_CACHE: TRUE
VSI_CACHE_SIZE: 1073741824
GDAL_DISABLE_READDIR_ON_OPEN: EMPTY_DIR
GDAL_HTTP_MERGE_CONSECUTIVE_RANGES: YES
GDAL_HTTP_MULTIPLEX: YES
GDAL_HTTP_VERSION: 2
PYTHONWARNINGS: ignore
WEB_CONCURRENCY: 4
command: ["uvicorn", "titiler.application.main:app", "--host", "0.0.0.0", "--port", "8001", "--workers", "1"]
ports:
- "8001:8001"
volumes:
- ./data:/data # Optional: mount local directory with your raster files
restart: unless-stopped
networks:
- caddy
labels:
caddy: vbos-titiler.ds.io
caddy.reverse_proxy: "{{upstreams 8001}}"

networks:
caddy:
Expand Down