forked from dockerfile/mongodb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
40 lines (31 loc) · 1000 Bytes
/
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
#
# MongoDB Dockerfile
#
# https://github.com/dockerfile/mongodb
#
# Pull base image.
FROM dockerfile/ubuntu
ADD config/mongodb.conf /config/mongodb.conf
ADD scripts/configure-admin-account.sh /scripts/configure-admin-account.sh
ADD scripts/create-admin-account.js /scripts/create-admin-account.js
ADD scripts/start-mongod.sh /scripts/start-mongod.sh
RUN chmod 755 /scripts/start-mongod.sh
RUN chmod 755 /scripts/configure-admin-account.sh
# Install MongoDB.
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 update && \
apt-get install -y mongodb-org && \
mkdir -p /data/db
# Define mountable directories.
VOLUME ["/data"]
# Define working directory.
WORKDIR /scripts
# Start the server for a first time.
CMD /scripts/start-mongod.sh
# Expose ports.
# - 27017: process
# - 28017: http
EXPOSE 27017
EXPOSE 28017