Merge /srv/deploy_1/app

This commit is contained in:
2020-09-18 04:30:52 +00:00
4 changed files with 18 additions and 7 deletions

1
.gitignore vendored
View File

@@ -9,3 +9,4 @@ fet2020/*/migrations/*
.flake8 .flake8
migrate migrate
run run
*.pid

View File

@@ -4,7 +4,8 @@ RUN python -m venv /opt/venv
# Make sure we use the virtualenv: # Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH" ENV PATH="/opt/venv/bin:$PATH"
RUN apk add --no-cache --virtual .build-deps ca-certificates gcc linux-headers musl-dev jpeg-dev zlib-dev libffi-dev \ RUN apk add --no-cache --virtual .build-deps ca-certificates gcc linux-headers \
musl-dev jpeg-dev zlib-dev libffi-dev \
&& pip install --upgrade pip && pip install --upgrade pip
COPY ./fet2020/requirements.txt /app/requirements.txt COPY ./fet2020/requirements.txt /app/requirements.txt
@@ -20,6 +21,7 @@ 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
RUN python manage.py makemigrations && python manage.py makemigrations posts members RUN python manage.py makemigrations && python manage.py makemigrations posts members

7
deployment/nginx.conf Normal file
View File

@@ -0,0 +1,7 @@
server {
listen 80;
location / {
include uwsgi_params;
uwsgi_pass unix:///tmp/uwsgi.sock;
}
}

View File

@@ -1,4 +1,5 @@
docker stop bb2 #docker stop bb2
docker container rm bb2 #docker container rm bb2
docker build -t test1 . docker build -t fet2020django .
docker run --name bb2 -d -p 8080:80 test1 docker network create fet-net
docker run --name fetdjango --network fet-net -d -p 8080:80 -v /srv/deploy_1/app/fet2020:/app fet2020django