support dockerfiles without expose command. closes #1083
This commit is contained in:
@@ -35,7 +35,7 @@ case "$1" in
|
|||||||
|
|
||||||
dockerfile)
|
dockerfile)
|
||||||
# extract first port from Dockerfile
|
# extract first port from Dockerfile
|
||||||
DOCKERFILE_PORT=$(grep EXPOSE Dockerfile | head -1 | awk '{ print $2 }')
|
DOCKERFILE_PORT=$(grep EXPOSE Dockerfile | head -1 | awk '{ print $2 }' || true)
|
||||||
[[ -n "$DOCKERFILE_PORT" ]] && dokku config:set-norestart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT
|
[[ -n "$DOCKERFILE_PORT" ]] && dokku config:set-norestart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT
|
||||||
|
|
||||||
# sticking with same pattern of building app image before pre-build for now.
|
# sticking with same pattern of building app image before pre-build for now.
|
||||||
|
|||||||
5
tests.mk
5
tests.mk
@@ -75,6 +75,10 @@ deploy-test-dockerfile:
|
|||||||
@echo deploying dockerfile app...
|
@echo deploying dockerfile app...
|
||||||
cd tests && ./test_deploy ./apps/dockerfile dokku.me
|
cd tests && ./test_deploy ./apps/dockerfile dokku.me
|
||||||
|
|
||||||
|
deploy-test-dockerfile-noexpose:
|
||||||
|
@echo deploying dockerfile-noexpose app...
|
||||||
|
cd tests && ./test_deploy ./apps/dockerfile-noexpose dokku.me
|
||||||
|
|
||||||
deploy-test-gitsubmodules:
|
deploy-test-gitsubmodules:
|
||||||
@echo deploying gitsubmodules app...
|
@echo deploying gitsubmodules app...
|
||||||
cd tests && ./test_deploy ./apps/gitsubmodules dokku.me
|
cd tests && ./test_deploy ./apps/gitsubmodules dokku.me
|
||||||
@@ -125,6 +129,7 @@ deploy-tests:
|
|||||||
@$(QUIET) $(MAKE) deploy-test-config
|
@$(QUIET) $(MAKE) deploy-test-config
|
||||||
@$(QUIET) $(MAKE) deploy-test-clojure
|
@$(QUIET) $(MAKE) deploy-test-clojure
|
||||||
@$(QUIET) $(MAKE) deploy-test-dockerfile
|
@$(QUIET) $(MAKE) deploy-test-dockerfile
|
||||||
|
@$(QUIET) $(MAKE) deploy-test-dockerfile-noexpose
|
||||||
@$(QUIET) $(MAKE) deploy-test-gitsubmodules
|
@$(QUIET) $(MAKE) deploy-test-gitsubmodules
|
||||||
@$(QUIET) $(MAKE) deploy-test-go
|
@$(QUIET) $(MAKE) deploy-test-go
|
||||||
@$(QUIET) $(MAKE) deploy-test-java
|
@$(QUIET) $(MAKE) deploy-test-java
|
||||||
|
|||||||
1
tests/apps/dockerfile-noexpose/CHECKS
Normal file
1
tests/apps/dockerfile-noexpose/CHECKS
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/ Hello World!
|
||||||
13
tests/apps/dockerfile-noexpose/Dockerfile
Normal file
13
tests/apps/dockerfile-noexpose/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
FROM ubuntu:trusty
|
||||||
|
ENV LC_ALL C
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
ENV DEBCONF_NONINTERACTIVE_SEEN true
|
||||||
|
|
||||||
|
RUN apt-get install -y software-properties-common && add-apt-repository ppa:chris-lea/node.js && apt-get update
|
||||||
|
RUN apt-get install -y build-essential curl postgresql-client-9.3 nodejs git
|
||||||
|
|
||||||
|
COPY . /app
|
||||||
|
WORKDIR /app
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
CMD npm start
|
||||||
2
tests/apps/dockerfile-noexpose/check_deploy
Executable file
2
tests/apps/dockerfile-noexpose/check_deploy
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e; output="$(curl -s -S $1)"; echo $output; test "$output" == "Hello World!"
|
||||||
13
tests/apps/dockerfile-noexpose/index.js
Normal file
13
tests/apps/dockerfile-noexpose/index.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
var express = require('express')
|
||||||
|
var app = express();
|
||||||
|
|
||||||
|
app.set('port', (process.env.PORT || 5000))
|
||||||
|
app.use(express.static(__dirname + '/public'))
|
||||||
|
|
||||||
|
app.get('/', function(request, response) {
|
||||||
|
response.send('Hello World!')
|
||||||
|
})
|
||||||
|
|
||||||
|
app.listen(app.get('port'), function() {
|
||||||
|
console.log("Node app is running at localhost:" + app.get('port'))
|
||||||
|
})
|
||||||
29
tests/apps/dockerfile-noexpose/package.json
Normal file
29
tests/apps/dockerfile-noexpose/package.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "node-js-sample",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"description": "A sample Node.js app using Express 4",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node index.js"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"express": "^4.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "0.10.x"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/heroku/node-js-sample"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"node",
|
||||||
|
"heroku",
|
||||||
|
"express"
|
||||||
|
],
|
||||||
|
"author": "Mark Pundsack",
|
||||||
|
"contributors": [
|
||||||
|
"Zeke Sikelianos <zeke@sikelianos.com> (http://zeke.sikelianos.com)"
|
||||||
|
],
|
||||||
|
"license": "MIT"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user