Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Metagenomics
metagenedb
Commits
0cddff3b
Commit
0cddff3b
authored
Jun 20, 2019
by
Kenzo-Hugo Hillion
♻
Browse files
update docker compose to work with 4 services
parent
0b4075b1
Pipeline
#12676
passed with stage
in 1 minute and 5 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docker-compose.dev.yaml
View file @
0cddff3b
...
...
@@ -3,9 +3,11 @@ version: '3.7'
services
:
backend
:
container_name
:
backend
build
:
./backend
build
:
context
:
./backend
volumes
:
-
./backend:/code
-
django-static:/backend/public/static
ports
:
-
"
8000:8000"
env_file
:
.env
...
...
@@ -24,6 +26,8 @@ services:
-
"
5433:5432"
volumes
:
-
db-data:/var/lib/postgresql/data
networks
:
-
main
frontend
:
build
:
...
...
@@ -42,19 +46,23 @@ services:
-
NODE_ENV=development
nginx
:
image
:
nginx:alpine
build
:
context
:
.
dockerfile
:
nginx/dev/Dockerfile
ports
:
-
"
80:80"
depends_on
:
-
backend
volumes
:
-
./nginx/dev.conf:/etc/nginx/nginx.conf:ro
-
./nginx/dev/dev.conf:/etc/nginx/nginx.conf:ro
-
django-static:/usr/src/app/static
networks
:
-
main
volumes
:
db-data
:
django-static
:
networks
:
main
:
...
...
nginx/dev/Dockerfile
0 → 100644
View file @
0cddff3b
FROM
nginx:1.13.12-alpine
COPY
nginx/dev/dev.conf /etc/nginx/nginx.conf
COPY
backend/public/static /usr/src/app/static/
EXPOSE
80
CMD
["nginx", "-g", "daemon off;"]
nginx/dev/dev.conf
0 → 100644
View file @
0cddff3b
user
nginx
;
worker_processes
1
;
events
{
worker_connections
1024
;
}
http
{
include
/
etc
/
nginx
/
mime
.
types
;
client_max_body_size
100
m
;
upstream
backend
{
server
backend
:
8000
;
}
upstream
frontend
{
server
frontend
:
8080
;
}
server
{
listen
80
;
charset
utf
-
8
;
# frontend urls
location
/ {
proxy_redirect
off
;
proxy_pass
http
://
frontend
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Host
$
http_host
;
}
# frontend dev-server
location
/
sockjs
-
node
{
proxy_redirect
off
;
proxy_pass
http
://
frontend
;
proxy_set_header
X
-
Real
-
IP
$
remote_addr
;
proxy_set_header
X
-
Forwarded
-
For
$
remote_addr
;
proxy_set_header
Host
$
host
;
proxy_set_header
Upgrade
$
http_upgrade
;
proxy_set_header
Connection
"upgrade"
;
}
# backend urls
location
~ ^/(
admin
|
api
|
catalog
|
auth
) {
proxy_redirect
off
;
proxy_pass
http
://
backend
;
proxy_set_header
X
-
Forwarded
-
For
$
proxy_add_x_forwarded_for
;
proxy_set_header
Host
$
http_host
;
}
# static files
location
/
static
{
autoindex
on
;
alias
/
usr
/
src
/
app
/
static
;
}
}
}
Write
Preview
Supports
Markdown
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