production fix url, settings.prod, docker fileswq
This commit is contained in:
parent
a1b018d52c
commit
5262a24c83
3
.key
Normal file
3
.key
Normal file
@ -0,0 +1,3 @@
|
||||
DJANGO_SETTINGS_MODULE=aitrainer_backoffice/aitrainer_backoffice/settings/prod.py
|
||||
MYSQL_ROOT_PASSWORD=andio2009
|
||||
MYSQL_USER=root
|
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
FROM python:3.7
|
||||
WORKDIR /aitrainer_backoffice
|
||||
ADD . /aitrainer_backoffice/
|
||||
RUN apt-get update && apt-get install vim -y
|
||||
RUN pip3 install uwsgi
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY uwsgi_params /var/www/aitrainer.info/
|
||||
COPY .key ./
|
||||
#ENV DJANGO_KEY=45u49283495j2435294234
|
||||
ENV DJANGO_SETTINGS_MODULE=aitrainer_backoffice/aitrainer_backoffice/settings/prod.py
|
||||
|
||||
|
||||
ENV PORT=8000
|
||||
EXPOSE 8000
|
2
docker-compose.sh
Executable file
2
docker-compose.sh
Executable file
@ -0,0 +1,2 @@
|
||||
export $(cat .key | xargs)
|
||||
docker-compose up -d
|
36
docker-compose.yml
Normal file
36
docker-compose.yml
Normal file
@ -0,0 +1,36 @@
|
||||
version: "3.7"
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
container_name: backoffice
|
||||
volumes:
|
||||
- .:/aitrainer_backoffice
|
||||
- media:/aitrainer_backoffice/aitrainer_backoffice/media
|
||||
depends_on:
|
||||
- mysql-server
|
||||
ports:
|
||||
- "8002:8000"
|
||||
command: gunicorn aitrainer_backoffice.aitrainer_backoffice.wsgi --env DJANGO_SETTINGS_MODULE=aitrainer_backoffice.aitrainer_backoffice.settings.prod --bind 0.0.0.0:8000 --workers 3
|
||||
|
||||
mysql-server:
|
||||
image: mysql:8.0.20
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: $MYSQL_ROOT_PASSWORD
|
||||
volumes:
|
||||
- mysql-data-backoffice:/var/lib/mysql
|
||||
ports:
|
||||
- "33060:3306"
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin:latest
|
||||
restart: always
|
||||
environment:
|
||||
PMA_HOST: mysql-server
|
||||
PMA_USER: $MYSQL_USER
|
||||
PMA_PASSWORD: $MYSQL_ROOT_PASSWORD
|
||||
ports:
|
||||
- "8085:80"
|
||||
volumes:
|
||||
mysql-data-backoffice:
|
||||
media:
|
13
requirements.txt
Normal file
13
requirements.txt
Normal file
@ -0,0 +1,13 @@
|
||||
django==3.0.8
|
||||
asgiref==3.2.10
|
||||
certifi==2020.6.20
|
||||
chardet==3.0.4
|
||||
idna==2.10
|
||||
pytz==2020.1
|
||||
sqlparse==0.3.1
|
||||
urllib3==1.25.9
|
||||
setuptools==49.2.0
|
||||
mysqlclient==2.0.1
|
||||
requests==2.24.0
|
||||
pillow==7.2.0
|
||||
gunicorn==20.0.4
|
13
uwsgi_params
Normal file
13
uwsgi_params
Normal file
@ -0,0 +1,13 @@
|
||||
uwsgi_param QUERY_STRING $query_string;
|
||||
uwsgi_param REQUEST_METHOD $request_method;
|
||||
uwsgi_param CONTENT_TYPE $content_type;
|
||||
uwsgi_param CONTENT_LENGTH $content_length;
|
||||
uwsgi_param REQUEST_URI $request_uri;
|
||||
uwsgi_param PATH_INFO $document_uri;
|
||||
uwsgi_param DOCUMENT_ROOT $document_root;
|
||||
uwsgi_param SERVER_PROTOCOL $server_protocol;
|
||||
uwsgi_param REMOTE_ADDR $remote_addr;
|
||||
uwsgi_param REMOTE_PORT $remote_port;
|
||||
uwsgi_param SERVER_ADDR $server_addr;
|
||||
uwsgi_param SERVER_PORT $server_port;
|
||||
uwsgi_param SERVER_NAME $server_name;
|
Loading…
Reference in New Issue
Block a user