-
Notifications
You must be signed in to change notification settings - Fork 96
/
Copy pathDockerfile.gcp
72 lines (53 loc) · 2.01 KB
/
Dockerfile.gcp
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
66
67
68
69
70
71
72
FROM python:2.7.9-slim
# FROM us-east1-docker.pkg.dev/gglobo-dbaas-hub/dbaas-docker-images/dbaas-base:latest
# Python optimization to run on docker
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
# Fix old repositories.
RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list
# Maybe run upgrade as well???
RUN apt-get update
# So we can install stuff that compiles with gcc
RUN apt-get install -y python-dev --force-yes
RUN apt-get install -y build-essential --force-yes
# Nice to have
RUN apt-get install -y nano --force-yes
RUN apt-get install -y htop --force-yes
RUN apt-get install -y vim --force-yes
RUN apt-get install -y ncdu --force-yes
RUN apt install -y --force-yes curl
# So we can install mysql libs properly
RUN apt install -y --force-yes default-libmysqlclient-dev
# So we can install LDAP
RUN apt install -y --force-yes python-ldap
RUN apt install -y --force-yes libldap2-dev
RUN apt install -y --force-yes libsasl2-dev
RUN apt install -y --force-yes libssl-dev
RUN apt install -y --force-yes mysql-client
RUN apt install -y --force-yes telnet
# Not sure what this does......... TODO test if needed?
# RUN sed '/st_mysql_options options;/a unsigned int reconnect;' /usr/include/mysql/mysql.h -i.bkp
# If we dont upgrade pip to a smaller version, it just give an error when trying to do the upgrade.
RUN pip install --upgrade pip==9.0.1
RUN pip install --upgrade pip
RUN pip install ipython==5.1.0
RUN pip install ipdb==0.10.1
RUN pip install -U setuptools
RUN pip install --upgrade distribute
# RUN export CFLAGS="-I$(xcrun --show-sdk-path)/usr/include/sasl"
RUN pip install python-ldap
COPY requirements.txt .
RUN pip install --no-cache-dir -i https://artifactory.globoi.com/artifactory/api/pypi/pypi-all/simple/ -r requirements.txt
# User, home, and app basics
RUN useradd --create-home app
WORKDIR /home/app
USER app
COPY . .
ARG build_info
RUN echo ${build_info} > build_info.txt
# RUN nc -lU /dev/log
# RUN mkdir /dev
USER root
RUN touch /dev/log
USER app
ENTRYPOINT [ "./gunicorn.sh" ]