зеркало из https://github.com/Azure/ipam.git
37 строки
642 B
Docker
37 строки
642 B
Docker
ARG BASE_IMAGE=registry.access.redhat.com/ubi8/python-39
|
|
FROM $BASE_IMAGE
|
|
|
|
ARG PORT=8080
|
|
|
|
# Set Environment Variable
|
|
ENV PORT=${PORT}
|
|
|
|
# Set the Working Directory
|
|
WORKDIR /ipam
|
|
|
|
# Switch to Root User
|
|
USER root
|
|
|
|
# Copy Requirements File
|
|
ADD ./requirements.txt /ipam
|
|
|
|
# Install Dependencies
|
|
RUN pip install --no-cache-dir --upgrade -r ./requirements.txt --progress-bar off
|
|
|
|
# Copy Application Scripts & Sources
|
|
ADD ./app ./app
|
|
ADD ./init.sh .
|
|
|
|
# Set Script Execute Permissions
|
|
RUN chmod +x init.sh
|
|
RUN chown -R 1001:0 /ipam
|
|
|
|
# Switch to Standard User
|
|
USER 1001
|
|
|
|
# Expose Port
|
|
EXPOSE $PORT
|
|
|
|
# Execute Startup Script
|
|
ENTRYPOINT ./init.sh ${PORT}
|