-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (51 loc) · 2.19 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
FROM phusion/baseimage:0.9.17
# Default to UTF-8 file.encoding
ENV LANG C.UTF-8
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
wget \
openjdk-7-jdk
# Mongo:
# Import MongoDB public GPG key AND create a MongoDB list file
RUN apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv 7F0CEB10
RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list
RUN apt-get update && apt-get install -y mongodb-org
# Create the MongoDB data directory
RUN mkdir -p /var/lib/mongodb
# Ruby
RUN apt-get update && \
apt-get install -y ruby ruby-dev ruby-bundler
RUN mkdir /data
RUN mkdir /data/extras
ADD docker/extras/ /data/extras
### fakes3
RUN chmod +x /data/extras/fakes3-0.2.3.gem
RUN gem install builder
RUN gem install --backtrace -V --local /data/extras/fakes3-0.2.3.gem
RUN mkdir /opt/fake-s3-root
ENV ENV_AMAZON_ENDPOINT="http://localhost:4567"
# elasticsearch
RUN wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
RUN echo "deb http://packages.elastic.co/elasticsearch/1.5/debian stable main" | tee -a /etc/apt/sources.list
RUN apt-get update && sudo apt-get install elasticsearch
# boot at start up
RUN update-rc.d elasticsearch defaults 95 10
# Prevent elasticsearch calling `ulimit`.
RUN sed -i 's/MAX_OPEN_FILES=/# MAX_OPEN_FILES=/g' /etc/init.d/elasticsearch
# docker sbt util (so we can run mongo-db-seeder + indexer)
ADD docker/cs-api-docker-util/target/scala-2.10/cs-api-docker-util-assembly-*.jar /opt/cs-api-docker-util/run.jar
RUN chmod +x /opt/cs-api-docker-util/run.jar
ADD target/universal/stage/conf/seed-data /opt/cs-api-docker-util/conf/seed-data
ADD target/universal/stage/conf/qti /opt/cs-api-docker-util/conf/qti
ADD target/universal/stage/conf/qti-templates /opt/cs-api-docker-util/conf/qti-templates
ADD corespring-components/components /opt/components
ENV CONTAINER_COMPONENTS_PATH="/opt/components"
ENV DEPLOY_ASSET_LOADER_JS=false
ADD docker/scripts/main /data/main
RUN chmod +x /data/main
EXPOSE 9000
ADD target/universal/stage/ /opt/corespring-api
CMD ["/data/main" ]
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*