Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adjust development setup #823

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions Dockerfile
Expand Up @@ -4,12 +4,12 @@ MAINTAINER Orlando Hohmeier <orlando@mesosphere.io>

WORKDIR /opt/marathon-ui

ADD . /opt/marathon-ui/
COPY ./entrypoint.sh /opt/marathon-ui/entrypoint.sh
RUN npm install -g gulp

USER root

VOLUME "/opt/marathon-ui/tests"
VOLUME "/opt/marathon-ui/dist"
VOLUME "/opt/marathon-ui"

ENTRYPOINT ["npm"]
CMD ["run", "serve"]
# Define entrypoint
ENTRYPOINT [ "/bin/bash", "/opt/marathon-ui/entrypoint.sh" ]
20 changes: 11 additions & 9 deletions docker-compose.yml
Expand Up @@ -68,23 +68,25 @@ services:
- ./resources/marathon-plugins:/plugins
- ./resources/marathon.plugin-conf.json:/plugin-conf.json
- ./resources/marathon.secret:/marathon.secret
marathon-ui:
toolchain:
build:
context: .
expose:
- "4200"
volumes:
- .:/opt/marathon-ui
proxy:
image: nginx:latest
hostname: marathon-ui
ports:
- "8080:8080"
- "8080:8080"
links:
- marathon-service
- toolchain
environment:
- DNSDOCK_ALIAS=marathon.docker
volumes:
- ./resources/marathon-ui.nginx.conf:/etc/nginx/nginx.conf
- dist:/usr/share/nginx/html
develop-environment:
build:
context: .
volumes:
- ./src:/opt/marathon-ui/src
- dist:/opt/marathon-ui/dist
- ./dist:/usr/share/nginx/html
volumes:
dist: {}
7 changes: 7 additions & 0 deletions entrypoint.sh
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [[ -n $* ]]; then
eval $*
else
tail -f /dev/null
fi
21 changes: 15 additions & 6 deletions resources/marathon-ui.nginx.conf
Expand Up @@ -26,23 +26,32 @@ http {

#gzip on;

upstream api {
upstream toolchain {
server toolchain:4200;
}

upstream marathon-service {
server marathon-service:8080;
}

server {
listen 8080;

location /ui {
alias /usr/share/nginx/html;
index index.html;
location ~ /ui/(.+) {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://toolchain/$1$is_args$args;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_redirect off;
}

location ~ /v2/(.+) {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://api/v2/$1$is_args$args;
proxy_pass http://marathon-service/v2/$1$is_args$args;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_redirect off;
Expand All @@ -52,7 +61,7 @@ http {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://api;
proxy_pass http://marathon-service;
proxy_ssl_session_reuse off;
proxy_set_header Host $http_host;
proxy_redirect off;
Expand Down