Skip to content

Commit

Permalink
Add gunicorn
Browse files Browse the repository at this point in the history
  • Loading branch information
charalamm committed Sep 27, 2023
1 parent 8bab547 commit 19e2e77
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ RUN python -m pip install --upgrade pip \
FROM python:3.10.12-slim-bullseye

COPY --from=build_tarball /terracotta/dist/terracotta-*.tar.gz /terracotta/terracotta.tar.gz
COPY --from=build_tarball /entrypoint.sh /entrypoint.sh

RUN pip install --upgrade pip \
&& pip install psycopg2-binary \
&& pip install psycopg2-binary gunicorn \
&& pip install /terracotta/terracotta.tar.gz \
&& rm -rf /terracotta

COPY --from=build_tarball /entrypoint.sh /entrypoint.sh

ENV TC_SERVER_PORT=5000
EXPOSE $TC_SERVER_PORT

Expand Down
11 changes: 10 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#!/bin/sh

terracotta serve --allow-all-ips --port $TC_SERVER_PORT -d $TC_DRIVER_PATH

# Validate that environment variables are set
if [ -z "$TC_DRIVER_PATH" ]; then
echo "TC_DRIVER_PATH is not set. Exiting."
exit 1
fi


# Start the server
gunicorn terracotta.server.app:app --bind 0.0.0.0:$TC_SERVER_PORT

0 comments on commit 19e2e77

Please sign in to comment.