forked from ryan-blunden/django-chatgpt-clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (43 loc) · 1.58 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# need ubuntu for torch/transformers used by some readers
FROM ubuntu:22.04
WORKDIR /app
# set some settings variables for Django
# Django settings are intended to crash on those variables because they are required
# but they are useless at this stage (for the 'python manage.py' calls below and 'reset_deploy.sh')
ARG DJANGO_SECRET_KEY=foo
ARG DJANGO_ALLOWED_HOSTS=foo
ARG DJANGO_ADMIN_URL=foo
ARG LLM_MODEL=foo
ARG LIBRE_OFFICE_PATH=foo
ARG RAG_VECTOR_STORES=foo
ARG RAG_VECTOR_STORE=foo
ARG RAG_DOCUMENT_STORE=foo
ARG RAG_INDEX_STORE=foo
ARG PORTAL_NAME=foo
ARG PORTAL_IMAGE=foo
# also set by docker compose
ENV DJANGO_SETTINGS_MODULE=llm_portal.settings.production
ENV DB_ENGINE=django.db.backends.postgresql
RUN DEBIAN_FRONTEND=noninteractive apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install curl python3.11 python3.11-venv git postgresql gcc python3.11-dev libreoffice -y; \
curl -sL https://deb.nodesource.com/setup_18.x | bash;\
apt-get install nodejs -y;\
git clone https://github.com/benbenz/django-llm-portal.git .; \
python3.11 -m venv .venv; \
. .venv/bin/activate; \
pip install -r requirements/production.txt; \
groupadd -g 1000 appuser; \
useradd -u 1000 -g appuser -M -d /app appuser; \
chown -R appuser:appuser /app; \
echo "Done";
# RUN . .venv/bin/activate; \
# python manage.py makemigrations; \
# python manage.py migrate; \
# ./reset_deploy.sh;
USER appuser
RUN . .venv/bin/activate; \
./reset_deploy.sh;
# chown -R appuser:appuser /app;
EXPOSE 8000/tcp
ENTRYPOINT [ "/bin/bash" , "-c"]
CMD ["./docker_run.sh"]