-
Notifications
You must be signed in to change notification settings - Fork 0
/
DockerfileWithDynamo
88 lines (67 loc) · 2.86 KB
/
DockerfileWithDynamo
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
78
79
80
81
82
83
84
85
86
87
FROM phusion/baseimage:0.9.16
# set env name to an arbitrary string
ENV ENV_NAME=ac-190
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"
# dynamo db
# Create the dynamoDb data directory
RUN mkdir -p /var/lib/dynamodb
# Create installation dir
RUN mkdir -p /opt/dynamo
RUN wget -qO - http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest.tar.gz | tar -zxvC /opt/dynamo
RUN chmod +x /opt/dynamo/DynamoDBLocal.jar
## environment variables for dynamo
## Use dynamo instead of mongo for session db
ENV ENV_DYNAMO_DB_ACTIVATE=true
## Use local dynamodb (instead of amazon)
ENV ENV_DYNAMO_DB_USE_LOCAL=false
## the port of the local dynamo db
ENV ENV_DYNAMO_DB_LOCAL_PORT=8000
## do you want the local db to be cleared?
ENV ENV_DYNAMO_DB_LOCAL_INIT=false
# 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
EXPOSE 9000
ADD target/universal/stage/ /opt/corespring-api
ADD docker/scripts/mainWithDynamo /data/mainWithDynamo
RUN chmod +x /data/mainWithDynamo
CMD ["/data/mainWithDynamo" ]
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*