Предрелизный коммит
This commit is contained in:
parent
adec5a2332
commit
3399583c4a
@ -1 +1 @@
|
||||
*/local_settings.py
|
||||
app/local_settings.py
|
||||
@ -0,0 +1,57 @@
|
||||
###########
|
||||
# BUILDER #
|
||||
###########
|
||||
|
||||
# pull official base image
|
||||
FROM python:3.10 as builder
|
||||
|
||||
# set work directory
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
# install system dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends gcc
|
||||
|
||||
# install python dependencies
|
||||
COPY ./requirements.txt .
|
||||
RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requirements.txt
|
||||
|
||||
|
||||
#########
|
||||
# FINAL #
|
||||
#########
|
||||
|
||||
# pull official base image
|
||||
FROM python:3.10
|
||||
|
||||
# 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
|
||||
RUN mkdir $APP_HOME/static
|
||||
WORKDIR $APP_HOME
|
||||
|
||||
# install dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends netcat-traditional
|
||||
RUN apt-get update && apt-get install -y libgl1-mesa-glx
|
||||
COPY --from=builder /usr/src/app/wheels /wheels
|
||||
COPY --from=builder /usr/src/app/requirements.txt .
|
||||
RUN pip install --upgrade pip
|
||||
RUN pip install --no-cache /wheels/*
|
||||
|
||||
# copy project
|
||||
COPY . $APP_HOME
|
||||
|
||||
RUN chown -R app:app $APP_HOME
|
||||
|
||||
USER app
|
||||
@ -21,6 +21,9 @@ CHANNEL_LAYERS = {
|
||||
},
|
||||
}
|
||||
|
||||
MIDDLEWARE = [
|
||||
"whitenoise.middleware.WhiteNoiseMiddleware",
|
||||
]
|
||||
# MIDDLEWARE = [
|
||||
# "whitenoise.middleware.WhiteNoiseMiddleware",
|
||||
# ]
|
||||
|
||||
|
||||
# STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
||||
@ -38,8 +38,6 @@ MIDDLEWARE = MIDDLEWARE + [
|
||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
||||
STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"
|
||||
|
||||
ROOT_URLCONF = 'app.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
uvicorn==0.34.3
|
||||
django==4.2
|
||||
dotenv==1.1.0
|
||||
dotenv
|
||||
channels==4.2.2
|
||||
whitenoise==6.9.0
|
||||
websockets==15.0.1
|
||||
websockets==15.0.1
|
||||
psycopg2-binary
|
||||
django-redis==5.4.0
|
||||
@ -1,6 +1,6 @@
|
||||
services:
|
||||
web:
|
||||
build: ./app/Dockerfile
|
||||
build: ./app
|
||||
container_name: web
|
||||
command: >
|
||||
sh -c "python manage.py collectstatic --noinput &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user