mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 18:22:21 +00:00
commit
fc8c377eab
3 changed files with 26 additions and 11 deletions
21
Dockerfile
21
Dockerfile
|
|
@ -3,7 +3,7 @@ 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
|
||||
RUN echo -e '#!/bin/sh\nexit 0' > /usr/sbin/policy-rc.d
|
||||
|
||||
# Install prerequisites
|
||||
RUN apt-get update
|
||||
|
|
@ -22,20 +22,19 @@ RUN apt-get install -y nodejs
|
|||
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
|
||||
# Install global packages
|
||||
RUN npm install -g gulp grunt-cli bower
|
||||
RUN cd /habitrpg && npm install
|
||||
RUN cd /habitrpg && bower install --allow-root
|
||||
|
||||
# Clone Habitica repo and install dependencies
|
||||
WORKDIR /habitrpg
|
||||
RUN git clone https://github.com/HabitRPG/habitrpg.git /habitrpg
|
||||
RUN npm install
|
||||
RUN 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
|
||||
RUN cp config.json.example config.json
|
||||
RUN mkdir -p ./website/build
|
||||
|
||||
# Start Habitica
|
||||
EXPOSE 3000
|
||||
WORKDIR /habitrpg/
|
||||
CMD ["npm", "start"]
|
||||
|
|
|
|||
3
docker-compose.dev.yml
Normal file
3
docker-compose.dev.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
web:
|
||||
volumes:
|
||||
- '.:/habitrpg'
|
||||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
web:
|
||||
build: .
|
||||
ports:
|
||||
- "3000:3000"
|
||||
links:
|
||||
- mongo
|
||||
environment:
|
||||
- NODE_DB_URI=mongodb://mongo/habitrpg
|
||||
|
||||
mongo:
|
||||
image: mongo
|
||||
ports:
|
||||
- "27017:27017"
|
||||
Loading…
Reference in a new issue