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

fix: fixed docker-compose.yml and renamed gdal_rio.env to .env.example #88

Merged
merged 3 commits into from
Apr 9, 2024
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
File renamed without changes.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ RUN pipenv run pip install -U pip
COPY requirements.txt requirements.txt
RUN pipenv run pip install -r requirements.txt
COPY src/cogserver cogserver
ENV HOST=0.0.0.0
ENV PORT=8000
ENV LOG_LEVEL=info
ENV RELOAD=--reload

ARG HOST=0.0.0.0
ARG PORT=8000
ARG LOG_LEVEL=info
ARG RELOAD=--reload

CMD pipenv run uvicorn cogserver:app --host ${HOST} --port ${PORT} --log-level ${LOG_LEVEL} ${RELOAD}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ a) pushing tags
```
# local development

The server's config variables are defined in [gdal_rio.env](/gdal_rio.env). By passing this file at runtime to
The server's config variables are defined in [.env](.env). To create `.env` file, please copy `env.example` file by using the command of `cp .env.example .env`. By passing this file at runtime to
docker-compose the server can be started using:

```commandline
docker-compose --env-file gdal_rio.env up --build
docker-compose --env-file .env up --build
```

[gdal_rio.env](/gdal_rio.env) contains several important environmental variables.
Expand Down
13 changes: 2 additions & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,15 @@ version: '3'
services:
cogserver:
# See https://github.com/developmentseed/titiler/discussions/387
#platform: linux/amd64
platform: linux/amd64
# enable `image` if you would like to use Docker image from Github package
#image: ghcr.io/undp-data/cogserver:latest
# enable `build` if you would like to build Docker image from source code
# image: undpgeohub.azurecr.io/cogserver-debug
build:
context: .
container_name: cogserver
# Enable the following volumes if you want to mount source code to Docker
volumes:
- "./src/cogserver:/opt/server/cogserver"
env_file:
- ./gdal_rio.env
environment:
- RELOAD=--reload
# the above env file contains the $PORT variable.
- .env
ports:
- "${PORT}:${PORT}"