# syntax=docker/dockerfile:1
|
|
|
|
FROM python:3.11.4-slim-buster
|
|
|
|
#FROM python:3.9.19-slim-bullseye
|
|
|
|
# set work directory
|
|
WORKDIR /app
|
|
|
|
# set environment variables
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
# install system dependencies
|
|
RUN apt-get update && apt-get install -y sqlite3 netcat
|
|
|
|
# create directory for the app user
|
|
RUN mkdir -p /app
|
|
|
|
# create the app user
|
|
#RUN addgroup --system app && adduser --system --group app
|
|
|
|
# create the appropriate directories
|
|
ENV APP_HOME=/app
|
|
RUN mkdir -p $APP_HOME
|
|
#RUN mkdir -p $APP_HOME/staticfiles
|
|
#RUN mkdir -p $APP_HOME/mediafiles
|
|
WORKDIR $APP_HOME
|
|
|
|
RUN pip install --upgrade pip
|
|
COPY ./requirements.txt .
|
|
RUN pip install -r /app/requirements.txt
|
|
|
|
# copy entrypoint.sh
|
|
COPY ./entrypoint.sh .
|
|
|
|
|
|
# copy project
|
|
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
|
|
WORKDIR $APP_HOME/biblioteca
|
|
|
|
# run entrypoint.sh
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|