k8s/app03/Dockerfile
2022-03-28 17:13:04 +08:00

29 lines
778 B
Docker

#Download base image ubuntu 20.04
FROM ubuntu:latest
# LABEL about the custom image
LABEL maintainer="pengtao@kingsome.cn"
LABEL version="0.1"
LABEL description="This is custom Docker Image for \
the C++ Services."
# Disable Prompt During Packages Installation
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update \
&& apt install -y python3 python3-pip \
&& python3 -m pip install fastapi uvicorn -i https://pypi.tuna.tsinghua.edu.cn/simple \
&& mkdir -p /app && chmod -R 755 /app \
&& rm -rf /var/lib/apt/lists/*
# Define the ENV variable
ENV APP_PORT=8000
EXPOSE $APP_PORT
# Copy start.sh script and define default command for the container
COPY . /app
WORKDIR /app
HEALTHCHECK CMD curl --fail http://localhost:$APP_PORT || exit 1
CMD ["/usr/bin/python3", "app.py"]