Skip to content

Commit 2089902

Browse files
authored
Merge pull request #16 from govlt/root-url
Allow setting root url
2 parents 431beb7 + 135e84c commit 2089902

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

api/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ ENV VIRTUAL_ENV=/app/.venv \
4040
PATH="/app/.venv/bin:$PATH" \
4141
SPATIALITE_LIBRARY_PATH=mod_spatialite.so \
4242
SENTRY_DSN="" \
43-
SENTRY_ENVIRONMENT="production"
44-
43+
SENTRY_ENVIRONMENT="production" \
44+
ROOT_URL=""
4545

4646
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
4747
COPY . .
48+
COPY --chmod=555 entrypoint.sh /opt/app/entrypoint.sh
4849

4950
COPY --from=database-builder --chmod=444 /opt/database/boundaries.sqlite /opt/database/data-sources/checksums.txt ./
5051

51-
CMD ["fastapi", "run", "main.py", "--port", "80"]
52+
53+
ENTRYPOINT ["/opt/app/entrypoint.sh"]

api/docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ services:
1010
- internal
1111
ports:
1212
- 9321:80
13+
environment:
14+
ROOT_URL: ''
15+
SENTRY_DSN: ''
16+
SENTRY_ENVIRONMENT: 'local'
1317

1418
networks:
1519
internal:

api/entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
# Run FastAPI server
4+
fastapi run main.py --port 80 --root-path "${ROOT_URL}"

0 commit comments

Comments
 (0)