forked from HabitRPG/habitica
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (32 loc) · 1.11 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
FROM ubuntu:trusty
MAINTAINER Sabe Jones <sabe@habitica.com>
# Avoid ERROR: invoke-rc.d: policy-rc.d denied execution of start.
RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d
# Install prerequisites
RUN apt-get update
RUN apt-get install -y \
build-essential \
curl \
git \
libkrb5-dev \
python
# Install NodeJS
RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
RUN apt-get install -y nodejs
# Clean up package management
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/*
# Clone Habitica repo and install dependencies
RUN git clone https://github.com/HabitRPG/habitrpg.git
RUN npm install -g gulp grunt-cli bower
RUN cd /habitrpg && npm install
RUN cd /habitrpg && bower install --allow-root
# Create environment config file and build directory
RUN cd /habitrpg && cp config.json.example config.json
RUN mkdir -p /habitrpg/website/build
# Point config.json to Mongo instance. Edit the IP address to your running Mongo container's IP before running.
RUN cd /habitrpg && sed -i 's/localhost/0.0.0.0/g' config.json
# Start Habitica
EXPOSE 3000
WORKDIR /habitrpg/
CMD ["npm", "start"]