forked from isb-cgc/ISB-CGC-Webapp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
69 lines (53 loc) · 2.26 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
66
67
68
69
###
#
# Copyright 2017, Institute for Systems Biology
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
###
# Dockerfile extending the Python Community image from Dockerhub with application files for a
# single application.
FROM python:3.9-bullseye
SHELL ["/bin/bash", "-c"]
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y wget
# TODO: we need to start using the keyring instead
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv A8D3785C
RUN wget "http://repo.mysql.com/mysql-apt-config_0.8.29-1_all.deb" -P /tmp
# install lsb-release (a dependency of mysql-apt-config), since dpkg doesn't
# do dependency resolution
RUN apt-get install -y lsb-release
RUN dpkg --install /tmp/mysql-apt-config_0.8.29-1_all.deb
# fetch the updated package metadata (in particular, mysql-server)
RUN apt-get update
# aaaand now let's install mysql-server
RUN apt-get install -y mysql-server
RUN apt-get -y install build-essential
RUN apt-get -y install --reinstall python3-m2crypto python3-cryptography
RUN apt-get -y install libxml2-dev libxmlsec1-dev swig
RUN pip install pexpect
RUN apt-get -y install unzip libffi-dev libssl-dev libmysqlclient-dev python3-mysqldb python3-dev libpython3-dev git ruby g++ curl
ADD . /app
# We need to recompile some of the items because of differences in compiler versions
RUN pip install -r /app/requirements.txt -t /app/lib/ --upgrade
RUN pip install gunicorn==21.2.0
ENV PYTHONPATH="/app:/app/lib:/app/IDC-Common:${PYTHONPATH}"
WORKDIR /app/
# Quick config check
RUN python manage.py check
# Until we figure out a way to do it in CircleCI without whitelisting IPs this has to be done by a dev from
# ISB
# RUN python /app/manage.py migrate --noinput
CMD gunicorn -c gunicorn.conf.py -b :$PORT idc.wsgi -w 5 -t 70