API port through env variable
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Starting FairHopper game server"
|
||||
PORT=${FAIRHOPPER_API_PORT=8010}
|
||||
|
||||
echo "Starting FairHopper game server on port ${PORT}"
|
||||
|
||||
uvicorn \
|
||||
main:app \
|
||||
--host 0.0.0.0 \
|
||||
--port ${FAIRHOPPER_API_PORT} \
|
||||
--port ${PORT} \
|
||||
--workers=1
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
FROM python:3.10.11-alpine3.17
|
||||
|
||||
# take arguments
|
||||
ARG INTERNAL_API_PORT
|
||||
ARG INTERNAL_WS_PORT
|
||||
|
||||
@ -14,7 +15,7 @@ COPY poetry.lock .
|
||||
|
||||
# create virtual environment
|
||||
RUN python -m venv /venv
|
||||
# set python thingies and activate virtual environment
|
||||
# set python thingies, set environment variables and activate virtual environment
|
||||
ENV \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
@ -28,6 +29,7 @@ RUN \
|
||||
# install python libs
|
||||
pip install -r requirements.txt --no-cache-dir --prefer-binary
|
||||
|
||||
# copy all relevant files
|
||||
COPY ./.docker/* ./
|
||||
COPY ./hopper ./hopper
|
||||
COPY ./main.py .
|
||||
|
||||
Reference in New Issue
Block a user