Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ ENV MU_SPARQL_ENDPOINT 'http://database:8890/sparql'
ENV MU_APPLICATION_GRAPH 'http://mu.semte.ch/application'
ENV NODE_ENV 'production'

ENV HOST '0.0.0.0'
ENV PORT '80'

ENV LOG_SPARQL_ALL 'true'
ENV DEBUG_AUTH_HEADERS 'true'

Expand All @@ -19,7 +22,7 @@ COPY . /usr/src/app
RUN chmod +x /usr/src/app/run-development.sh
RUN chmod +x /usr/src/app/build-production.sh

EXPOSE 80
EXPOSE ${PORT}

CMD sh boot.sh

Expand Down
6 changes: 4 additions & 2 deletions helpers/mu/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import bodyParser from 'body-parser';

var app = express();

var port = process.env.PORT || '80';
var hostname = process.env.HOST || '0.0.0.0';
var bodySizeLimit = process.env.MAX_BODY_SIZE || '100kb';

// parse JSONAPI content type
Expand Down Expand Up @@ -35,8 +37,8 @@ const errorHandler = function(err, req, res, next) {
};

// start server
app.listen( 80, function() {
console.log(`Starting server on port 80 in ${app.get('env')} mode`);
app.listen( port, hostname, function() {
console.log(`Starting server on ${hostname}:${port} in ${app.get('env')} mode`);
});

export default app;
Expand Down