diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..18d2445 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:6 + +RUN yarn global add npm@5 + +RUN mkdir /app +WORKDIR /app + +ADD ./package.json . + +RUN npm install + +CMD npm run start diff --git a/docker-compose.yaml b/docker-compose.yaml index ed5b911..30359c3 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,24 +1,21 @@ -slackbot: - image: node:6 - entrypoint: /app/entrypoint.sh - environment: - - DATABASE_URL=postgres://postgres:standup@database/standup - - PORT=3000 - - LOG_LEVEL=10 - expose: - - 3000 - ports: - - 3000 - working_dir: /app - volumes: - - ./:/app - - /app/node_modules - links: - - database:database -database: - image: postgres:latest - environment: - - POSTGRES_DB=standup - - POSTGRES_PASSWORD=standup - expose: - - 5432 \ No newline at end of file +version: "2" +services: + database: + image: postgres:latest + environment: + - POSTGRES_DB=standup + - POSTGRES_PASSWORD=standup + expose: + - 5432 + standup-bot: + build: . + entrypoint: /app/entrypoint.sh + environment: + - DATABASE_URL=postgres://postgres:standup@database/standup + - PORT=3000 + - LOG_LEVEL=10 + ports: + - 3000 + volumes: + - ./:/app + - /app/node_modules diff --git a/entrypoint.sh b/entrypoint.sh index 75e280d..c31d3b2 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,3 +1,2 @@ -#!/bin/bash -npm install && \ -./wait-for-it.sh -s -q -t 0 database:5432 -- npm start \ No newline at end of file +#!/usr/bin/env bash +./wait-for-it.sh -s -q -t 0 database:5432 -- npm start