Skip to content

Commit

Permalink
Merge pull request #753 from hotosm/hotfixes
Browse files Browse the repository at this point in the history
Hotfixes
  • Loading branch information
robsavoye authored Aug 23, 2023
2 parents 6d666c5 + 5f66041 commit e045d32
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ version: "3"
volumes:
fmtm_db_data:
fmtm_images:
fmtm_tiles:
central_db_data:

networks:
Expand Down Expand Up @@ -51,6 +52,7 @@ services:
container_name: fmtm_api
volumes:
- fmtm_images:/opt/app/images
- fmtm_tiles:/opt/app/tiles
- ./src/backend/app:/opt/app
# - ../osm-fieldwork/osm_fieldwork:/home/appuser/.local/lib/python3.10/site-packages/osm_fieldwork
depends_on:
Expand Down
1 change: 1 addition & 0 deletions src/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ RUN useradd -r -u 900 -m -c "hotosm account" -d /home/appuser -s /bin/false appu
&& chmod +x /container-entrypoint.sh
# Add volume for persistent images
VOLUME /opt/app/images
VOLUME /opt/app/tiles
# Change to non-root user
USER appuser

Expand Down
9 changes: 7 additions & 2 deletions src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -2114,8 +2114,13 @@ async def get_project_tiles(

zooms = [12, 13, 14, 15, 16, 17, 18, 19]
source = source
base = f"{TILESDIR}/{source}tiles"
outfile = f"{TILESDIR}/{project_id}_{uuid.uuid4()}_tiles.mbtiles"
tiles_path_id = uuid.uuid4()
tiles_dir = f"{TILESDIR}/{tiles_path_id}"
base = f"{tiles_dir}/{source}tiles"
outfile = f"{tiles_dir}/{project_id}_{source}tiles.mbtiles"

if not os.path.exists(base):
os.makedirs(base)

tile_path_instance = db_models.DbTilesPath(
project_id=project_id,
Expand Down

0 comments on commit e045d32

Please sign in to comment.