This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
forked from pedrocesarti/hubot-slack-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (47 loc) · 1.72 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM ubuntu:xenial
MAINTAINER "Pedro Cesar" <[email protected]>
EXPOSE 6379
# VARIABLES
ENV DIRECTORY "/home/hubot"
ENV DIRECTORY2 "/home/hubot/scripts"
ENV NAME "marvin"
ENV OWNER "me"
ENV DESCRIPTION "Hubot teste."
ENV NODE_VERSION "6.11.0"
# INSTALL SYSTEM TOOLS
RUN apt-get update && \
apt-get install -y \
sudo \
autoconf \
build-essential \
ca-certificates \
curl \
git-core \
redis-server
# USER MANAGEMENT FOR APP
RUN useradd -d "$DIRECTORY" -ms /bin/bash hubot
RUN echo "hubot ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
WORKDIR "$DIRECTORY"
USER hubot
# DOWNLOAD NODENV AND PATH
RUN git clone git://github.com/OiNutter/nodenv.git /home/hubot/.nodenv && \
git clone git://github.com/OiNutter/node-build.git /home/hubot/.nodenv/plugins/node-build
ENV PATH /home/hubot/.nodenv/shims:/home/hubot/.nodenv/bin:/home/hubot/.nodenv/versions/$NODE_VERSION/bin:$PATH
# INSTALL NODENV VERSION
RUN nodenv install "$NODE_VERSION"
RUN nodenv global "$NODE_VERSION"
RUN nodenv rehash
# CREATE HUBOT BASE
RUN npm config set unsafe-perm true
RUN npm cache clean && npm install -g yo
ADD conf/ "$DIRECTORY"
ADD scripts/ "$DIRECTORY2"
RUN npm install generator-hubot
# INSTALL APP
RUN yo hubot --owner="$OWNER" --name="$NAME" --description="DESCRIPTION" --defaults
# STARTING APP AND SERVICES
RUN echo "sudo /usr/bin/redis-server /etc/redis/redis.conf ; /home/hubot/bin/hubot --adapter slack > /home/hubot/hubot.log 2>&1 &" > /home/hubot/init_app.sh
#RUN echo "sudo /usr/bin/redis-server /etc/redis/redis.conf ; "$DIRECTORY"/bin/hubot --adapter slack > "$DIRECTORY"/hubot.log 2>&1 &" > "$DIRECTORY"/init_app.sh
RUN chmod +x "$DIRECTORY"/init_app.sh
# START EVERYTHING AND WATCHING LOGS
CMD bash /home/hubot/init_app.sh && tail -f /home/hubot/hubot.log