fix: backend image fixes

pull/118/head
corpulent 3 years ago
parent e665a0037f
commit 595ff998d5

@ -13,11 +13,15 @@ RUN apt-get update && \
postgresql-contrib \
wget \
nano \
curl \
lsof \
curl \
supervisor && \
rm -rf /var/lib/apt/lists/*
RUN wget https://github.com/kubernetes/kompose/releases/download/v1.26.1/kompose_1.26.1_amd64.deb
RUN apt install ./kompose_1.26.1_amd64.deb && \
rm kompose_1.26.1_amd64.deb
RUN useradd uwsgi && adduser uwsgi root
RUN useradd supervisor && adduser supervisor root
@ -26,19 +30,12 @@ RUN pip install --upgrade pip && \
pip install -r ./requirements.txt && \
rm ./requirements.txt
RUN touch /var/log/backend_out.log && \
touch /var/log/django.log
RUN chmod g+w -R /var/log/
EXPOSE 9000 9001
COPY ./services/backend/src ./server
COPY ./services/backend/configs/supervisor/api.conf /etc/supervisor/conf.d/api.conf
COPY ./services/backend/configs/uwsgi ./config/uwsgi
COPY ./services/backend/configs/uwsgi ./configs/uwsgi
EXPOSE 9000 9001
RUN rm -rf /tmp/uwsgi && \
mkdir -p /tmp/uwsgi && \
ln -s ./config/uwsgi/uwsgi.ini /tmp/uwsgi/
HEALTHCHECK CMD curl --fail http://localhost:9000/v1 || exit 1
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
CMD ["/usr/local/bin/uwsgi", "--ini", "/home/configs/uwsgi/uwsgi.ini"]

@ -3,6 +3,6 @@ nodaemon=true
[program:app]
priority=1
user = uwsgi
command = /usr/local/bin/uwsgi --ini /tmp/uwsgi/uwsgi.ini
user=uwsgi
command=/usr/local/bin/uwsgi --ini /home/config/uwsgi/uwsgi.ini
autorestart=false

@ -1,6 +1,10 @@
[uwsgi]
ini = :base
socket = 0.0.0.0:9000
# use socket option a third-party router (nginx),
# use http option to set uwsgi to accept incoming
# HTTP requests and route them by itself
http = 0.0.0.0:9000
master = true
processes = 5
@ -8,7 +12,7 @@ processes = 5
[base]
chdir = /home/server
module = server.wsgi:application
module = main.wsgi:application
chmod-socket=666
uid = uwsgi
gid = uwsgi

@ -1,6 +1,5 @@
django==4.0.4
django-cors-headers==3.11.0
django-axes==5.32.0
djangorestframework==3.13.1
djangorestframework-simplejwt==5.1.0
django-storages==1.13.1

Loading…
Cancel
Save