зеркало из https://github.com/Azure/ipam.git
Updated dockerfiles to support both RHEL and Debian
This commit is contained in:
Родитель
8196609ac3
Коммит
957ed426ad
|
@ -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}
|
||||
|
|
|
@ -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}
|
||||
|
|
Загрузка…
Ссылка в новой задаче