Clean up repo and remove docker
This commit is contained in:
@@ -1,51 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export DOCKER_OPTS=""
|
||||
PROJECT="web20"
|
||||
|
||||
echo "SIKWEB 2.0 Dockerific install script"
|
||||
echo "===================================="
|
||||
|
||||
echo "Checking if docker is installed..."
|
||||
docker --version
|
||||
if [ "$?" -ne 0 ]
|
||||
then
|
||||
echo "Installing docker..."
|
||||
curl -fsSL https://get.docker.com/ | sh
|
||||
fi
|
||||
|
||||
systemctl status docker.service >/dev/null || { echo "Docker daemon is not running. Please start it!"; exit 1; }
|
||||
|
||||
echo "Checking if docker-compose is installed..."
|
||||
docker-compose --version
|
||||
if [ "$?" -ne 0 ]
|
||||
then
|
||||
echo "Installing docker-compose 1.11.2..."
|
||||
curl -L https://github.com/docker/compose/releases/download/1.11.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
fi
|
||||
|
||||
|
||||
echo "Building db container..."
|
||||
docker-compose -p "$PROJECT" build db || { echo "Failed to build db!"; exit 1; }
|
||||
docker-compose -p "$PROJECT" up -d db
|
||||
|
||||
echo "Copying settings..."
|
||||
cp -n sikweb/settings-sample.py sikweb/settings.py || { echo "Failed to copy settings!"; exit 1; }
|
||||
|
||||
echo "Building web container..."
|
||||
docker-compose -p "$PROJECT" build web
|
||||
|
||||
sleep 10
|
||||
echo "Running manage.py commands..."
|
||||
docker-compose -p "$PROJECT" run web python manage.py migrate --noinput || { echo "Failed to apply migrations!"; exit 1; }
|
||||
docker-compose -p "$PROJECT" run web python manage.py createdefaultadmin || { echo "Failed to create default admin user."; }
|
||||
echo "generating dummydata"
|
||||
docker-compose -p "$PROJECT" run web python /code/misc/create_dummydata.py || { echo "Failed to create default admin user."; }
|
||||
|
||||
echo "Starting web container..."
|
||||
docker-compose -p "$PROJECT" up -d web || { echo "Failed to start containers!"; exit 1; }
|
||||
|
||||
|
||||
|
||||
echo "Done."
|
||||
@@ -1,2 +0,0 @@
|
||||
FROM postgres:9.6
|
||||
COPY scripts/db/init.sql /docker-entrypoint-initdb.d/init.sql
|
||||
@@ -6,3 +6,5 @@ ALTER ROLE sik SET timezone TO 'UTC';
|
||||
CREATE DATABASE sik
|
||||
ENCODING 'UTF8'
|
||||
OWNER sik;
|
||||
GRANT ALL PRIVILEGES ON DATABASE sik TO sik;
|
||||
ALTER USER sik CREATEDB;
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
# TODO https://github.com/Kazanz/docker-nginx-uwsgi-django/blob/master/Dockerfile
|
||||
#FROM ubuntu:16.04
|
||||
|
||||
|
||||
#RUN apt-get update
|
||||
#Install python dependencies
|
||||
#RUN apt-get install -y python3-dev python3 python3-pip python3
|
||||
# install nginx
|
||||
#RUN apt-get install -y nginx
|
||||
# install install packet dependencies
|
||||
#RUN apt-get install -y mysql-client libmysqlclient-dev libssl-dev
|
||||
|
||||
#RUN mkdir -p /code
|
||||
#RUN mkdir -p /run
|
||||
#WORKDIR /code
|
||||
#ADD requirements.txt /code/
|
||||
#ADD scripts/production/nginx.conf /etc/nginx/sites-enabled/default
|
||||
|
||||
#RUN pip3 install -r requirements.txt
|
||||
#ADD . /code/
|
||||
#RUN python3 manage.py collectstatic --no-input
|
||||
|
||||
#EXPOSE 80
|
||||
|
||||
#ENTRYPOINT ["/usr/bin/uwsgi", "/code/scripts/production/uwsgi.ini"]
|
||||
#ENTRYPOINT ["/bin/bash"]
|
||||
|
||||
FROM python:3.5-alpine
|
||||
|
||||
RUN apk add --update \
|
||||
nginx \
|
||||
supervisor \
|
||||
python-dev \
|
||||
build-base \
|
||||
linux-headers \
|
||||
pcre-dev \
|
||||
py-pip \
|
||||
vim \
|
||||
mysql-client \
|
||||
mysql-dev \
|
||||
openssl-dev \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
zlib-dev\
|
||||
&& rm -rf /var/cache/apk/* \
|
||||
&& chown -R nginx:www-data /var/lib/nginx
|
||||
|
||||
RUN mkdir -p /code
|
||||
RUN mkdir -p /run
|
||||
RUN mkdir -p /run/nginx
|
||||
RUN chmod -R 777 /run
|
||||
|
||||
WORKDIR /code
|
||||
ADD . /code/
|
||||
ADD requirements.txt /code/
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
RUN python manage.py collectstatic --no-input
|
||||
|
||||
|
||||
RUN rm -f /etc/nginx/nginx.conf
|
||||
ADD scripts/production/nginx.conf /etc/nginx/nginx.conf
|
||||
RUN mkdir /etc/nginx/sites-enabled
|
||||
ADD scripts/production/nginx-app.conf /etc/nginx/sites-enabled/default
|
||||
|
||||
RUN rm /etc/supervisord.conf
|
||||
ADD scripts/production/supervisord.conf /etc/supervisord.conf
|
||||
CMD ["supervisord", "-n"]
|
||||
@@ -1,14 +0,0 @@
|
||||
server{
|
||||
listen 80;
|
||||
server_name _;
|
||||
location / {
|
||||
uwsgi_pass unix:///run/django.socket;
|
||||
include /etc/nginx/uwsgi_params;
|
||||
}
|
||||
location /static {
|
||||
alias /code/static;
|
||||
}
|
||||
location /media {
|
||||
alias /code/media;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#user nobody;
|
||||
worker_processes 4;
|
||||
|
||||
error_log /dev/stdout debug;
|
||||
#error_log logs/error.log notice;
|
||||
#error_log logs/error.log info;
|
||||
#pid run/nginx.pid;
|
||||
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include mime.types;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
default_type application/octet-stream;
|
||||
keepalive_timeout 65;
|
||||
sendfile on;
|
||||
}
|
||||
daemon off;
|
||||
@@ -1,17 +0,0 @@
|
||||
[supervisord]
|
||||
|
||||
[supervisorctl]
|
||||
|
||||
[program:app-uwsgi]
|
||||
command = /usr/local/bin/uwsgi --ini /code/scripts/production/uwsgi.ini
|
||||
stdout_logfile = /dev/stdout
|
||||
stderr_logfile = /dev/stderr
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:nginx-app]
|
||||
command = /usr/sbin/nginx
|
||||
stdout_logfile = /dev/stdout
|
||||
stderr_logfile = /dev/stderr
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile_maxbytes=0
|
||||
@@ -1,8 +0,0 @@
|
||||
FROM python:3.5
|
||||
ENV PYTHONBUFFERED 1
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
RUN mkdir -p /code
|
||||
WORKDIR /code
|
||||
ADD requirements.txt /code/
|
||||
RUN pip install -r requirements.txt
|
||||
ADD . /code/
|
||||
@@ -1 +0,0 @@
|
||||
../../requirements.txt
|
||||
Reference in New Issue
Block a user