Skip to content

Commit a7e9392

Browse files
committed
Revert "OpenConceptLab/ocl_issues#897 Run OCL API using gunicorn"
This reverts commit dbeff0d.
1 parent 7ce0b5a commit a7e9392

3 files changed

Lines changed: 8 additions & 40 deletions

File tree

Dockerfile

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,12 @@
1-
FROM python:3.9.6-alpine as builder
1+
FROM python:3.8.3
22
ENV PYTHONUNBUFFERED 1
3-
ENV PYTHONDONTWRITEBYTECODE 1
43
ARG SOURCE_COMMIT
5-
6-
RUN apk update && apk upgrade && \
7-
apk add --no-cache bash git gcc openssl-dev libffi-dev postgresql-dev python3-dev musl-dev cargo
8-
9-
RUN pip install --upgrade pip
10-
114
RUN mkdir /code
12-
WORKDIR /code
135
ADD requirements.txt /code/
14-
15-
RUN pip wheel --no-cache-dir --wheel-dir /code/wheels -r requirements.txt
16-
17-
FROM python:3.9.6-alpine
18-
19-
RUN addgroup -S ocl && adduser -S ocl -G ocl
20-
21-
ENV APP_HOME=/home/ocl/code
22-
23-
RUN mkdir -p $APP_HOME
24-
WORKDIR $APP_HOME
25-
26-
RUN apk update && apk add --no-cache libpq bash
27-
COPY --from=builder /code/wheels /wheels
28-
COPY --from=builder /code/requirements.txt .
29-
RUN pip install --no-cache /wheels/*
30-
RUN rm -rf /wheels
31-
32-
ADD --chown=ocl:ocl . $APP_HOME
33-
34-
USER ocl
6+
WORKDIR /code
7+
RUN pip install packaging
8+
RUN pip install -r requirements.txt
9+
ADD . /code/
3510

3611
RUN chmod +x set_build_version.sh
3712
RUN ["bash", "-c", "./set_build_version.sh"]
@@ -42,5 +17,4 @@ RUN chmod +x start_celery_worker.sh
4217
RUN chmod +x ping_celery_worker.sh
4318
RUN chmod +x start_flower.sh
4419
EXPOSE 8000
45-
4620
CMD ["bash", "-c", "./startup.sh"]

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
Django==3.1.12
22
psycopg2==2.8.5
3-
gunicorn==20.1.0
43
djangorestframework==3.11.2
54
pylint==2.5.3
65
pydash==4.8.0
@@ -18,7 +17,7 @@ celery[redis]==4.4.7
1817
celery_once==3.0.1
1918
flower==0.9.5
2019
redis==3.5.3
21-
kombu==4.6.11
20+
kombu==4.5.0
2221
django-elasticsearch-dsl==7.1.4
2322
drf-yasg==1.17.1
2423
git+https://github.com/snyaggarwal/django-queryset-csv

startup.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,5 @@ python manage.py import_lookup_values
2121
echo "Populating text from extras.about"
2222
python manage.py populate_text_from_extras_about
2323

24-
if [[ "$ENVIRONMENT" = "development" ]]; then
25-
echo "Starting up the development server"
26-
python manage.py runserver 0.0.0.0:${API_PORT:-8000}
27-
else
28-
echo "Starting up the production server"
29-
gunicorn core.wsgi:application --bind 0.0.0.0:${API_PORT:-8000}
30-
fi
24+
echo "Starting up the server"
25+
python manage.py runserver 0.0.0.0:${API_PORT:-8000}

0 commit comments

Comments
 (0)