-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
65 lines (51 loc) · 1.69 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM python:3.9.16-bullseye
RUN apt-get update \
# dependencies for building Python packages \
&& apt-get install -y build-essential \
# psycopg2 dependencies
&& apt-get install -y libpq-dev \
# Translations dependencies
&& apt-get install -y gettext \
# Nginx
&& apt-get install nginx vim procps curl libpq-dev -y --no-install-recommends \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
COPY nginx.default /etc/nginx/sites-available/default
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
# Set environment variables
ENV PIP_DISABLE_PIP_VERSION_CHECK 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set work directory
WORKDIR /code
# Copy project
COPY . .
RUN chown -R www-data:www-data /code
# Install dependenciess
COPY ./requirements.txt .
RUN pip install -r requirements.txt
COPY ./setup_db.sh .
RUN sed -i 's/\r$//g' setup_db.sh
RUN chmod +x setup_db.sh
COPY ./setup_clickhouse.py .
RUN sed -i 's/\r$//g' setup_clickhouse.py
RUN chmod +x setup_clickhouse.py
COPY ./start-server.sh .
RUN sed -i 's/\r$//g' start-server.sh
RUN chmod +x start-server.sh
COPY ./start-celery-worker.sh .
RUN sed -i 's/\r$//g' start-celery-worker.sh
RUN chmod +x start-celery-worker.sh
COPY ./start-celery-beat.sh .
RUN sed -i 's/\r$//g' start-celery-beat.sh
RUN chmod +x start-celery-beat.sh
COPY ./start-celery-flower.sh .
RUN sed -i 's/\r$//g' start-celery-flower.sh
RUN chmod +x start-celery-flower.sh
COPY ./start-kafka-consumer.sh .
RUN sed -i 's/\r$//g' start-kafka-consumer.sh
RUN chmod +x start-kafka-consumer.sh
EXPOSE 8080
STOPSIGNAL SIGTERM