Added postgresql client package to Dockerfiles and psycopg2-binary to requirements.txt, removed unused matplotlib code/package from analysis/cluster.py and requirements.txt, replaced commands in docker start.sh file with new management commands.
This commit is contained in:
@@ -11,7 +11,6 @@ WORKDIR /app/server/website
|
||||
|
||||
COPY ./docker/credentials.py ./website/settings
|
||||
COPY ./docker/start.sh .
|
||||
COPY ./docker/createadmin.py .
|
||||
COPY ./docker/wait-for-it.sh .
|
||||
|
||||
RUN chmod +x ./*.sh
|
||||
|
||||
@@ -8,12 +8,12 @@ ENV PATH=${GRADLE_HOME}/bin:${PATH}
|
||||
COPY ./server/website/requirements.txt /
|
||||
|
||||
RUN yum update -y \
|
||||
&& yum install -y mariadb mariadb-devel \
|
||||
&& yum install -y mariadb mariadb-devel postgresql \
|
||||
https://centos7.iuscommunity.org/ius-release.rpm \
|
||||
&& yum install -y gcc git MySQL-python openldap-devel \
|
||||
parallel python36u python36u-devel python36u-libs \
|
||||
python36u-pip python36u-tkinter rabbitmq-server \
|
||||
java-11-openjdk-devel wget which unzip curl \
|
||||
python36u-pip rabbitmq-server java-11-openjdk-devel \
|
||||
wget which unzip curl \
|
||||
&& yum -y autoremove \
|
||||
&& yum clean metadata \
|
||||
&& yum clean all \
|
||||
|
||||
@@ -9,8 +9,8 @@ ENV PATH=${GRADLE_HOME}/bin:${PATH}
|
||||
COPY ./server/website/requirements.txt /
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y python3.6 python3-pip python3-tk \
|
||||
mysql-client libmysqlclient-dev python-mysqldb \
|
||||
&& apt-get install -y python3.6 python3-pip mysql-client \
|
||||
libmysqlclient-dev python-mysqldb postgresql-client \
|
||||
openjdk-11-jdk git unzip wget curl \
|
||||
&& wget https://services.gradle.org/distributions/${GRADLE_VERSION}-bin.zip \
|
||||
&& unzip ${GRADLE_VERSION}-bin.zip -d /opt \
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import django
|
||||
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "website.settings")
|
||||
django.setup()
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
username = os.environ.get('ADMIN_USER', 'admin')
|
||||
password = os.environ.get('ADMIN_PASSWORD')
|
||||
email = os.environ.get('ADMIN_EMAIL', 'admin@example.com')
|
||||
|
||||
if password:
|
||||
if not User.objects.filter(username=username).exists():
|
||||
print(f"Creating '{username}' user...")
|
||||
User.objects.create_superuser(username=username,
|
||||
password=password,
|
||||
email=email)
|
||||
print(f"'{username}' user created!")
|
||||
else:
|
||||
print(f"'{username}' user already exists! Setting '{username}' password")
|
||||
u = User.objects.get(username=username)
|
||||
u.set_password(password)
|
||||
u.save()
|
||||
@@ -29,7 +29,6 @@ services:
|
||||
environment:
|
||||
DEBUG: 'True'
|
||||
ADMIN_PASSWORD: 'changeme'
|
||||
ADMIN_EMAIL: 'admin@example.com'
|
||||
MYSQL_USER: 'root'
|
||||
MYSQL_PASSWORD: 'ottertune'
|
||||
MYSQL_HOST: 'mysql'
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
## Needs a connection to a DB so migrations go here
|
||||
python3 manage.py makemigrations website
|
||||
python3 manage.py migrate
|
||||
python3 createadmin.py
|
||||
python3 manage.py createuser admin $ADMIN_PASSWORD --superuser
|
||||
|
||||
python3 manage.py celery worker --loglevel=info --pool=threads &
|
||||
python3 manage.py celerybeat --verbosity=2 --loglevel=info &
|
||||
python3 manage.py startcelery
|
||||
python3 manage.py runserver 0.0.0.0:8000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user