-
-
Notifications
You must be signed in to change notification settings - Fork 233
/
Dockerfile
77 lines (54 loc) · 2.2 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM ubuntu:14.04
# Fix environment and locale issues
ENV TERM linux
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
ENV PATH "$PATH:/usr/bin"
### Setup system ###
# Install mongodb from ppa
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 \
&& echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' \
| tee /etc/apt/sources.list.d/mongodb.list \
&& apt-get -y update \
&& apt-get -y install mongodb-org \
&& mkdir -p /data/db
# Mongo DB and Redis will store their data in /data; make it a VOLUME.
VOLUME ["/data"]
# Add nodejs repository and install required packages
RUN apt-get -y install curl
RUN curl -sL https://deb.nodesource.com/setup | sudo bash -
# Install system dependencies
RUN apt-get -y update
RUN apt-get -y install redis-server supervisor nginx python-dev python-pip \
git ruby python-software-properties python g++ make nodejs \
build-essential ruby-dev
RUN gem install compass
RUN npm install -g brunch
RUN mkdir /home/cloudtunes
WORKDIR /home/cloudtunes
### Set up cloudtunes-server ###
ADD cloudtunes-server/requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt
ADD cloudtunes-server /home/cloudtunes/cloudtunes-server
RUN pip install -e ./cloudtunes-server
ADD cloudtunes-server/production/supervisor.ini \
/etc/supervisor/conf.d/cloudtunes.conf
### Set up cloudtunes-webapp ###
ADD cloudtunes-webapp /home/cloudtunes/cloudtunes-webapp
RUN cd cloudtunes-webapp \
&& npm install \
&& brunch b --env config-dist.coffee
### User ###
RUN groupadd -r cloudtunes -g 433 \
&& useradd -u 431 -r -g cloudtunes -d /home/cloudtunes \
-s /usr/sbin/nologin -c "Docker image user" cloudtunes \
&& chown -R cloudtunes:cloudtunes /home/cloudtunes
### Config API keys ###
# Use add, so we can make sure that the file gets cached, and we can check if it's changed since the image was built
ADD cloudtunes-server/cloudtunes/settings/local.py /home/cloudtunes/cloudtunes-server/cloudtunes/settings/local.py
### Launch ###
# https://docs.docker.com/articles/using_supervisord/
CMD ["supervisord", "--nodaemon"]
EXPOSE 8000