Skip to content

Commit

Permalink
fix: fixed docker-compose.yml and renamed gdal_rio.env to .env.example (
Browse files Browse the repository at this point in the history
#88)

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

* fix: added port for docker

* revert port setting
  • Loading branch information
JinIgarashi authored Apr 9, 2024
1 parent 72431ce commit 1d6e5ad
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
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}"



0 comments on commit 1d6e5ad

Please sign in to comment.