Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ability to create stand-alone docker instance #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This file describes how to build slack-pokemon into a runnable linux container with
# all dependencies installed.

# Set the base image to Ubuntu
FROM ubuntu

# Update
run apt-get -y update

# Install node and npm
###run apt-get -y install nodejs npm
run apt-get -y install nodejs-legacy npm


### Currently going to use supervisord to run everything in a single container
# Also install redis locally
run apt-get -y install redis-server
run apt-get -y install supervisor

add ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf

# Define working directory
WORKDIR /src
# Copy current directory into container
ADD . /src

# Get node_modules
run npm install

# Expose slack-pokemon's port (no need to expose redis)
EXPOSE 5000

# Start supervisor
cmd ["supervisord", "-n"]
15 changes: 15 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[supervisord]
nodaemon=true

[program:redis]
user=redis
command=/usr/bin/redis-server
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true

[program:slack-pokemon]
command=npm start
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true