setup nginx docker
This commit is contained in:
31
web/Dockerfile
Normal file
31
web/Dockerfile
Normal file
@@ -0,0 +1,31 @@
|
||||
FROM python:3-slim
|
||||
|
||||
# set work directory
|
||||
# WORKDIR /usr/src/app
|
||||
|
||||
# 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
|
||||
ENV HOME=/home/app
|
||||
ENV APP_HOME=/home/app/web
|
||||
RUN mkdir $APP_HOME
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
# set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
# install dependencies
|
||||
RUN pip install --upgrade pip
|
||||
COPY ./requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
# chown all the files to the app user
|
||||
RUN chown -R app:app $APP_HOME
|
||||
|
||||
# change to the app user
|
||||
USER app
|
||||
8
web/requirements.txt
Normal file
8
web/requirements.txt
Normal file
@@ -0,0 +1,8 @@
|
||||
asgiref==3.8.1
|
||||
Django==5.1.3
|
||||
gunicorn==23.0.0
|
||||
holidays==0.61
|
||||
packaging==24.2
|
||||
python-dateutil==2.9.0.post0
|
||||
six==1.16.0
|
||||
sqlparse==0.5.2
|
||||
Reference in New Issue
Block a user