Skip to content

Commit

Permalink
add static-image-api to docker-compose.yml (#2619)
Browse files Browse the repository at this point in the history
  • Loading branch information
JinIgarashi authored Jan 3, 2024
1 parent 3fd3a61 commit b70014a
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 6 deletions.
12 changes: 9 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Usage

- Copy `.env.example` to `.env` under `sites/geohub` folder
- Copy `.env.docker.example` to `.env` under `sites/geohub` folder

```shell
cd sites/geohub
cp .env.example .env
cp .env.docker.example .env
cd ../..
```

Expand All @@ -28,7 +28,11 @@ make docker-build
make docker-up
```

Backend services like titiler will be launched in docker.
The following backend services will be launched in docker.

- titiler: http://localhost:8000
- pgtileserv: http://localhost:7800
- static API: http://localhost:9000

Then, open another terminal to launch sveltekit by the following command at root folder of the repository.

Expand All @@ -37,6 +41,8 @@ make build # for first time or you have changed anything under packages
make dev
```

note. make sure you configure URLs for titiler, pgtilserv and static API in `.env` file

- test production environment

if you want to test GeoHub in production environment, the following commands can allow you to do it. This command will build Docker image with exactly same way to deploy to Azure App Service.
Expand Down
10 changes: 10 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
cogserver:
image: ghcr.io/undp-data/cogserver:latest
container_name: cogserver
restart: unless-stopped
ports:
- 8000:80
environment:
Expand All @@ -65,7 +66,16 @@ services:
pg_tileserv:
image: pramsey/pg_tileserv:20231005
container_name: pg_tileserv
restart: unless-stopped
environment:
- DATABASE_URL=${DATABASE_CONNECTION:-''}
ports:
- 7800:7800

static_image_api:
image: undpgeohub.azurecr.io/geohub-static-image-api:develop
container_name: static_image_api
restart: unless-stopped
ports:
- 9000:3000
entrypoint: /app/entrypoint.sh
42 changes: 42 additions & 0 deletions sites/geohub/.env.docker.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# private variables only accessed from server
# see https://kit.svelte.dev/docs/modules#$env-dynamic-private
# GIS server endpoints
MARTIN_API_ENDPOINT=
PGTILESERV_API_ENDPOINT=http://localhost:7800
TITILER_ENDPOINT=http://localhost:8000/cog

AZURE_STORAGE_ACCOUNT=
AZURE_STORAGE_ACCESS_KEY=
# Storage account for data uploading
AZURE_STORAGE_ACCOUNT_UPLOAD=
AZURE_STORAGE_ACCESS_KEY_UPLOAD=
AZURE_SERVICE_BUS_CONNECTIONSTRING=
AZURE_SERVICE_BUS_QUEUE_NAME=
DATABASE_CONNECTION=
# Private dynamic variables for Azure Active Directory (imported via $env/dynamic/private in Auth.js)
# these dynamic variables are loaded from `.env` in local, and they are loaded from application settings in server
# These variables need to be registered in Azure AppService from portal in production
# On UNIX systems you can use `openssl rand -hex 32` or
# https://generate-secret.vercel.app/32 to generate a secret.
AUTH_SECRET=
AZURE_AD_B2C_TENANT_ID=
AZURE_AD_B2C_CLIENT_ID=
AZURE_AD_B2C_CLIENT_SECRET=

# GitHub OAuth Apps variables can be generated from the below URL
# https://github.com/organizations/UNDP-Data/settings/applications
# geohub-localhost is for http://localhost:5173/auth/callback/github
# geohub-dev is for https://dev.undpgeohub.org/auth/callback/github
# geohub-prod is for https://geohub.data.undp.org/auth/callback/github
GEOHUB_GITHUB_ID=
GEOHUB_GITHUB_SECRET=

# Connection string for Azure PubSub
AZURE_PUBSUB_CONNECTIONSTRING=
AZURE_PUBSUB_GROUP_DATA_PIPELINE=

# endpoint of static image api
GEOHUB_STATIC_IMAGE_API=http://localhost:9000/api

# this setting is only used when localhost
GEOHUB_API_ENDPOINT=http://localhost:5173
6 changes: 3 additions & 3 deletions sites/geohub/.env.example
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# private variables only accessed from server
# see https://kit.svelte.dev/docs/modules#$env-dynamic-private
# GIS server endpoints
MARTIN_API_ENDPOINT=
PGTILESERV_API_ENDPOINT=http://localhost:7800
TITILER_ENDPOINT=http://localhost:8000/cog
MARTIN_API_ENDPOINT=https://martin.undpgeohub.org
PGTILESERV_API_ENDPOINT=https://pgtileserv.undpgeohub.org
TITILER_ENDPOINT=https://titiler.undpgeohub.org/cog

AZURE_STORAGE_ACCOUNT=
AZURE_STORAGE_ACCESS_KEY=
Expand Down
1 change: 1 addition & 0 deletions sites/geohub/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.env
.env.*
!.env.example
!.env.docker.example
.idea
.vscode/
/.svelte-kit
Expand Down

0 comments on commit b70014a

Please sign in to comment.