Skip to content

Commit

Permalink
docker-compose is now working
Browse files Browse the repository at this point in the history
  • Loading branch information
Const committed Aug 12, 2017
1 parent e9b87c9 commit 3058cbd
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGODB_APPLICATION_DATABASE=app_db_name
6 changes: 2 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ FROM node:8-alpine

WORKDIR /usr/app

ADD . /usr/app
COPY package.json .
RUN npm install --quiet

EXPOSE 8080

CMD ["npm", "start"]
COPY . .
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: "3"
services:
web:
build: .
# deploy:
# replicas: 5
# resources:
# limits:
# cpus: "0.1"
# memory: 50M
# restart_policy:
# condition: on-failure
volumes:
- .:/usr/app
command: npm start
ports:
- "80:8080"
networks:
- webnet
# depends_on:
# - mongodb
env_file: .env

# mongodb:
# image: mvertes/alpine-mongo
# ports:
# - "27017:27017"

networks:
webnet:
1 change: 1 addition & 0 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const HOST = '0.0.0.0';
// App
const app = express();
const host = process.env.HOSTNAME || '0.0.0.0';

app.get('/', (req, res) => {
res.send(`<h1>Hello world!!</h1><p>${host}</p>`);
});
Expand Down

0 comments on commit 3058cbd

Please sign in to comment.