This repository has been archived by the owner on Jun 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDockerfile
53 lines (44 loc) · 1.7 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
FROM python:3.8.2-slim-buster
LABEL maintainer="frederic.t.chan@gmail.com"
ENV REFRESHED_AT 20181129
ENV MODE PRODUCTION
ENV FLASK_ENV production
ENV PIPENV_VENV_IN_PROJECT 1
ENV DATADOG_SERVICE_NAME=everyclass-server DD_TRACE_ANALYTICS_ENABLED=true DD_LOGS_INJECTION=true
# ENV LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"
WORKDIR /var/app
# build uWSGI and Python plugin for current python version
# reference on how to build uwsgi python plugin: https://bradenmacdonald.com/blog/2015/uwsgi-emperor-multiple-python
# Why we need these packages?
# - procps contains useful proccess control commands like: free, kill, pkill, ps, top
# - wget is quite basic tool
# - git for using git in our app
# - gcc, libpcre3-dev for compiling uWSGI
# - libffi-dev for installing Python package cffi
# - libssl-dev for installing Python package cryptography
# - vim for online debugging
RUN apt-get update \
&& apt-get install -y --no-install-recommends procps wget gcc libpcre3-dev git libffi-dev libssl-dev vim \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& pip install uwsgi
# install gor
RUN cd / \
&& mkdir gor \
&& cd gor \
&& wget https://github.com/buger/goreplay/releases/download/v0.16.1/gor_0.16.1_x64.tar.gz \
&& tar xzf gor_0.16.1_x64.tar.gz \
&& rm gor_0.16.1_x64.tar.gz
COPY . /var/app
# install Python dependencies, make entrypoint executable
RUN pip3 install --upgrade pip \
&& pip3 install pipenv \
&& pipenv sync \
&& pip3 install uwsgitop \
&& rm -r /root/.cache \
&& chmod +x ./deploy/docker-cmd.sh
RUN mkdir -p /var/calendar_files \
&& mkdir -p /var/run/datadog \
&& touch /var/run/datadog/dsd.socket
ENV UWSGI_HTTP_SOCKET ":80"
CMD ["deploy/docker-cmd.sh"]