net/flask/Dockerfile

35 lines
664 B
Text
Raw Normal View History

2023-11-17 19:58:12 -05:00
FROM python:3
# create directory for the app user
RUN mkdir -p /home/app
# create the app user
RUN addgroup --system app && adduser --system --group app
# create the appropriate directories
2023-11-17 21:07:16 -05:00
ENV APP_HOME=/app
2023-11-17 19:58:12 -05:00
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
2022-02-03 17:27:25 -05:00
# install dependencies
2024-02-23 12:05:20 -05:00
RUN apt-get update && apt-get install -y --no-install-recommends netcat-openbsd gcc
COPY ./requirements.txt .
RUN pip install -r requirements.txt
2023-11-17 19:58:12 -05:00
# copy entrypoint.sh
COPY ./entrypoint.sh $APP_HOME
2022-02-03 17:27:25 -05:00
# copy project
2023-11-17 19:58:12 -05:00
COPY . $APP_HOME
# chown all the files to the app user
RUN chown -R app:app $APP_HOME
# change to the app user
USER app
2022-02-03 17:27:25 -05:00
# run entrypoint.sh
2024-02-23 12:05:20 -05:00
ENTRYPOINT ["./entrypoint.sh"]