Updated dockerfiles to support both RHEL and Debian

This commit is contained in:
Matthew Garrett 2022-09-16 15:29:16 -07:00
Родитель 8196609ac3
Коммит 957ed426ad
3 изменённых файлов: 23 добавлений и 4 удалений

Просмотреть файл

@ -3,12 +3,27 @@ FROM $BASE_IMAGE
ARG PORT=80
# Set Environment Variable
ENV PORT=${PORT}
# Copy Requirements File
ADD ./requirements.txt $HOME
# Install Dependencies
RUN pip install --no-cache-dir --upgrade -r ./requirements.txt
# Copy Application Scripts & Sources
ADD ./init.sh $HOME
ADD ./app $HOME/app
# Switch to Root User
USER root
# Set Script Execute Permissions
RUN chmod +x init.sh
# Expose Port
EXPOSE $PORT
CMD uvicorn "app.main:app" --reload --host "0.0.0.0" --port $PORT
# Execute Startup Script
ENTRYPOINT ./init.sh ${PORT}

5
engine/init.sh Normal file
Просмотреть файл

@ -0,0 +1,5 @@
#!/bin/sh
PORT=$1
uvicorn "app.main:app" --reload --host "0.0.0.0" --port ${PORT}

Просмотреть файл

@ -24,6 +24,5 @@ RUN chmod +x init.sh
# Expose Port
EXPOSE $PORT
# Inject ENV Variables & Start Server
# CMD npx --yes react-inject-env set && npx --yes http-server -a 0.0.0.0 -P http://localhost? -p $PORT build
ENTRYPOINT ["init.sh", ${PORT}]
# Execute Startup Script
ENTRYPOINT ./init.sh ${PORT}