Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
8498e546
authored
Jun 09, 2020
by
Chif Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run asgi in a different container in production
parent
f1869ef5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
3 deletions
+29
-3
Dockerfile
+2
-2
Dockerfile.prod
+1
-1
config/nginx/recircle.conf
+12
-0
docker-compose.prod.yml
+14
-0
No files found.
Dockerfile
View file @
8498e546
...
@@ -9,8 +9,8 @@ EXPOSE 8000/tcp
...
@@ -9,8 +9,8 @@ EXPOSE 8000/tcp
COPY
Pipfile* .env ./
COPY
Pipfile* .env ./
# This env variable needed to pipenv find .env file
# This env variable needed to pipenv find .env file
ENV
PIPENV_DOTENV_LOCATION=/usr/cloud/portal/.env
ENV
PIPENV_DOTENV_LOCATION=/usr/cloud/portal/.env
# Install dependencies
# Install dependencies
RUN
pipenv install
RUN
pipenv install
-d
# Copy sources
# Copy sources
COPY
./recircle ./recircle
COPY
./recircle ./recircle
# Set working dir where the manage.py found
# Set working dir where the manage.py found
...
...
Dockerfile.prod
View file @
8498e546
...
@@ -10,7 +10,7 @@ COPY Pipfile* .env ./
...
@@ -10,7 +10,7 @@ COPY Pipfile* .env ./
# This env variable needed to pipenv find .env file
# This env variable needed to pipenv find .env file
ENV PIPENV_DOTENV_LOCATION=/usr/cloud/portal/.env
ENV PIPENV_DOTENV_LOCATION=/usr/cloud/portal/.env
# Install dependencies
# Install dependencies
RUN pipenv install
-d
RUN pipenv install
# Copy sources
# Copy sources
COPY ./recircle ./recircle
COPY ./recircle ./recircle
# Set working dir where the manage.py found
# Set working dir where the manage.py found
...
...
config/nginx/recircle.conf
View file @
8498e546
...
@@ -2,6 +2,10 @@ upstream recircle {
...
@@ -2,6 +2,10 @@ upstream recircle {
server
backend
:
8000
;
server
backend
:
8000
;
}
}
upstream
wsbackend
{
server
daphne
-
server
:
8001
;
}
server
{
server
{
listen
80
;
listen
80
;
...
@@ -20,6 +24,14 @@ server {
...
@@ -20,6 +24,14 @@ server {
proxy_redirect
off
;
proxy_redirect
off
;
}
}
location
/
ws
/ {
proxy_pass
http
://
wsbackend
;
proxy_http_version
1
.
1
;
proxy_set_header
Upgrade
$
http_upgrade
;
proxy_set_header
Connection
"Upgrade"
;
proxy_set_header
Host
$
host
;
}
location
/
static
/ {
location
/
static
/ {
alias
/
static
/;
alias
/
static
/;
...
...
docker-compose.prod.yml
View file @
8498e546
...
@@ -54,5 +54,19 @@ services:
...
@@ -54,5 +54,19 @@ services:
-
db
-
db
-
redis
-
redis
daphne-server
:
build
:
context
:
.
dockerfile
:
./Dockerfile.prod
command
:
pipenv run daphne -b 0.0.0.0 -p 8001 recircle.asgi:application
expose
:
-
"
8001"
networks
:
-
backend
depends_on
:
-
backend
-
db
-
redis
networks
:
networks
:
backend
:
backend
:
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment