fixes for docker
This commit is contained in:
@@ -21,8 +21,8 @@ COPY --from=builder /opt/venv /opt/venv
|
|||||||
ENV PATH="/opt/venv/bin:$PATH"
|
ENV PATH="/opt/venv/bin:$PATH"
|
||||||
|
|
||||||
COPY ./fet2020 /app
|
COPY ./fet2020 /app
|
||||||
COPY ./deployment/nginx.conf /etc/nginx/conf.d/nginx.conf
|
COPY ./deployment/nginx.conf /etc/nginx/conf.d/fet2020.conf
|
||||||
|
|
||||||
RUN python manage.py makemigrations && python manage.py makemigrations posts members
|
#RUN python manage.py makemigrations && python manage.py makemigrations posts members
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 8080;
|
||||||
|
|
||||||
|
location /assets {
|
||||||
|
alias /app/static;
|
||||||
|
try_files $uri $uri/ =404;
|
||||||
|
}
|
||||||
location / {
|
location / {
|
||||||
include uwsgi_params;
|
include uwsgi_params;
|
||||||
uwsgi_pass unix:///tmp/uwsgi.sock;
|
uwsgi_pass unix:///tmp/uwsgi.sock;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
3
fet2020/initdb
Executable file
3
fet2020/initdb
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
python manage.py makemigrations && python manage.py makemigrations posts members \
|
||||||
|
&& python manage.py migrate
|
||||||
@@ -1,5 +1,19 @@
|
|||||||
#docker stop bb2
|
docker stop fetdjango
|
||||||
#docker container rm bb2
|
docker container rm fetdjango
|
||||||
|
docker stop mariadb
|
||||||
|
docker container rm mariadb
|
||||||
docker build -t fet2020django .
|
docker build -t fet2020django .
|
||||||
docker network create fet-net
|
docker network create fet-net
|
||||||
docker run --name fetdjango --network fet-net -d -p 8080:80 -v /srv/deploy_1/app/fet2020:/app fet2020django
|
docker run --name fetdjango --network fet-net -d -p 8080:8080 \
|
||||||
|
-v /srv/deploy_1/app/fet2020:/app fet2020django
|
||||||
|
docker run --name mariadb \
|
||||||
|
--network fet-net -d -p 3306:3306 \
|
||||||
|
-v mariadb2:/var/lib/mysql \
|
||||||
|
# -e SKIP_INNODB=yes \
|
||||||
|
-e MYSQL_DATABASE=wordpressdb \
|
||||||
|
-e MYSQL_USER=wordpressuser \
|
||||||
|
-e MYSQL_PASSWORD=hguyFt6S95dgfR4ryb \
|
||||||
|
jbergstroem/mariadb-alpine
|
||||||
|
|
||||||
|
docker exec fetdjango ./initdb
|
||||||
|
|
||||||
|
|||||||
11
runmariadb
Executable file
11
runmariadb
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
docker stop mysql
|
||||||
|
docker container rm mysql
|
||||||
|
docker volume rm mariadb2
|
||||||
|
docker run -d --name mysql -p 3308:3306 \
|
||||||
|
-v mariadb2:/var/lib/mysql \
|
||||||
|
-e SKIP_INNODB=no \
|
||||||
|
-e MYSQL_DATABASE=fet2020db \
|
||||||
|
-e MYSQL_USER=user \
|
||||||
|
-e MYSQL_PASSWORD=hgu \
|
||||||
|
-e MYSQL_ROOT_PASSWORD=hgu \
|
||||||
|
jbergstroem/mariadb-alpine
|
||||||
Reference in New Issue
Block a user