Skip to content

Commit

Permalink
#2935: nginx.dockerfile, rely on hiera arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jeff1evesque committed Apr 29, 2018
1 parent 7222daf commit 3b045a2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions dockerfile/nginx.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,22 @@ ARG LISTEN_PORT
ARG MEMBERS

## copy files into container
COPY hiera.yaml $ROOT_PROJECT/hiera.yaml
COPY hiera $ROOT_PROJECT/hiera
COPY puppet/environment/$ENVIRONMENT/modules/reverse_proxy $ROOT_PUPPET/code/modules/reverse_proxy

##
## provision with puppet: either build a web, or api nginx image.
##
## docker build --build-arg TYPE=api --build-arg RUN=false --build-arg VHOST=machine-learning-api.com --build-arg HOST_PORT=9090 --build-arg LISTEN_PORT=6000 --build-arg MEMBERS='localhost:6001' -f nginx.dockerfile -t jeff1evesque/ml-nginx-api:0.7 .
## docker build --build-arg TYPE=web --build-arg RUN=false --build-arg VHOST=machine-learning-web.com --build-arg HOST_PORT=8080 --build-arg LISTEN_PORT=5000 --build-arg MEMBERS='localhost:5001' -f nginx.dockerfile -t jeff1evesque/ml-nginx-web:0.7 .
## docker build --build-arg TYPE=api --build-arg RUN=false --build-arg VHOST=machine-learning-api.com --build-arg HOST_PORT=9090 --build-arg LISTEN_PORT=6000 -f nginx.dockerfile -t jeff1evesque/ml-nginx-api:0.7 .
## docker build --build-arg TYPE=web --build-arg RUN=false --build-arg VHOST=machine-learning-web.com --build-arg HOST_PORT=8080 --build-arg LISTEN_PORT=5000 -f nginx.dockerfile -t jeff1evesque/ml-nginx-web:0.7 .
##
## docker run --hostname nginx-api --name nginx-api -d jeff1evesque/ml-nginx-api:0.7
## docker run --hostname nginx-web --name nginx-web -d jeff1evesque/ml-nginx-web:0.7
##
RUN $PUPPET apply -e "class { reverse_proxy: \
run => 'false', \
type => '$TYPE', \
vhost => '$VHOST', \
host_port => '$HOST_PORT', \
listen_port => $LISTEN_PORT, \
members => '$MEMBERS', \
} " --modulepath=$CONTRIB_MODULES:$MODULES --confdir=$ROOT_PUPPET/puppet
run => 'false', \
} " --modulepath=$CONTRIB_MODULES:$MODULES --confdir=$ROOT_PUPPET

## start nginx
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 3b045a2

Please sign in to comment.