resecntly
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -162,3 +162,4 @@ cython_debug/
|
|||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
_media/cluster/
|
_media/cluster/
|
||||||
|
wheelhouse
|
||||||
|
33
Dockerfile
Normal file
33
Dockerfile
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
# pull official base image
|
||||||
|
FROM python:3.10-slim-buster
|
||||||
|
|
||||||
|
# set work directory
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# set environment variable
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
# copy project files
|
||||||
|
COPY . /usr/src/app/
|
||||||
|
|
||||||
|
# install system dependencies
|
||||||
|
RUN apt-get update
|
||||||
|
#RUN apt-get install -y gcc pkg-config default-libmysqlclient-dev python-dev vim systemd
|
||||||
|
RUN apt-get install -y gcc pkg-config default-libmysqlclient-dev python-dev
|
||||||
|
RUN apt-get clean
|
||||||
|
|
||||||
|
# install python dependencies
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
# collect static files
|
||||||
|
# RUN python manage.py collectstatic --noinput
|
||||||
|
|
||||||
|
# expose the port
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
# command to run
|
||||||
|
CMD ["gunicorn", "--workers=3", "--bind=0.0.0.0:8000", "auth_prj.wsgi:application"]
|
||||||
|
|
||||||
|
|
34
Dockerfile_default
Normal file
34
Dockerfile_default
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# pull official base image
|
||||||
|
FROM python:3.8-slim-buster
|
||||||
|
|
||||||
|
# set work directory
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# set environment variables
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
# copy requirements and wheelhouse first (for caching)
|
||||||
|
COPY requirements.txt .
|
||||||
|
COPY wheelhouse/ ./wheelhouse/
|
||||||
|
|
||||||
|
# install system dependencies
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y gcc pkg-config default-libmysqlclient-dev python3-dev vim systemd && \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
|
# install Python dependencies from .whl
|
||||||
|
RUN pip install --upgrade pip && \
|
||||||
|
pip install --no-index --find-links=wheelhouse -r requirements.txt
|
||||||
|
|
||||||
|
# copy actual project source code
|
||||||
|
COPY . /usr/src/app/
|
||||||
|
|
||||||
|
# collect static files
|
||||||
|
RUN python manage.py collectstatic --noinput
|
||||||
|
|
||||||
|
# expose the port
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
|
# run using gunicorn
|
||||||
|
CMD ["gunicorn", "--workers=3", "--bind=0.0.0.0:8000", "drf_prj.wsgi:application"]
|
@ -1,2 +1,4 @@
|
|||||||
# msa-django-auth
|
# msa-django-auth
|
||||||
|
|
||||||
|
mkdir -p wheelhouse
|
||||||
|
pip download -r requirements.txt -d wheelhouse/
|
||||||
|
@ -77,8 +77,12 @@ CORS_ALLOWED_ORIGINS = [
|
|||||||
"http://192.168.0.100:3000",
|
"http://192.168.0.100:3000",
|
||||||
"https://demo.test",
|
"https://demo.test",
|
||||||
"http://demo.test",
|
"http://demo.test",
|
||||||
|
"https://www.demo.test",
|
||||||
"https://sample.test",
|
"https://sample.test",
|
||||||
"http://sample.test",
|
"http://sample.test",
|
||||||
|
"http://www.sample.test",
|
||||||
|
"http://auth.sample.test",
|
||||||
|
"http://blog.sample.test",
|
||||||
]
|
]
|
||||||
|
|
||||||
# by.sdjo 2025-04-22
|
# by.sdjo 2025-04-22
|
||||||
|
@ -24,3 +24,4 @@ sqlparse==0.5.3
|
|||||||
typing_extensions==4.13.2
|
typing_extensions==4.13.2
|
||||||
uritemplate==4.1.1
|
uritemplate==4.1.1
|
||||||
urllib3==2.4.0
|
urllib3==2.4.0
|
||||||
|
gunicorn==20.1.0
|
Reference in New Issue
Block a user