forked from yesodweb/persistent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (69 loc) · 2.59 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
78
79
80
81
82
83
from stackbrew/ubuntu:14.04
maintainer Greg Weber
RUN apt-get install -y adduser
RUN adduser --disabled-password persistent
RUN echo "Defaults:persistent !requiretty" >> /etc/sudoers
RUN apt-get update
RUN apt-get install -y haskell-platform
# Above installs ghc 7.6 to /usr/bin/
# Below install ghc 7.8 to /usr/local/bin/
ADD http://www.haskell.org/ghc/dist/7.8.3/ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz
RUN apt-get install -y xz-utils
RUN tar xf ghc-7.8.3-x86_64-unknown-linux-deb7.tar.xz
RUN apt-get install -y g++ make
RUN cd ghc-7.8.3 && ./configure && make install && cd ..
RUN rm -fr ghc-7.8.3-x86_64-unknown-linux-deb7.tar.bz2 ghc-7.8.3
# Postgres
RUN apt-get install -y postgresql postgresql-client postgresql-contrib libpq-dev
# Sqlite
RUN apt-get install -y sqlite3 libsqlite3-dev
# Redis
RUN apt-get install -y redis-server
# MongoDB
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
RUN echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list.d/10gen.list
RUN mkdir -p /data/db
RUN apt-get update
RUN apt-get install -y mongodb-10gen || echo "upstart error expected"
# MySQL
RUN apt-get install -y libpcre3-dev mysql-server libmysqlclient-dev || echo "need to run mysql --configure"
RUN echo "en_US.UTF-8 UTF-8" >> /var/lib/locales/supported.d/local
RUN dpkg-reconfigure locales
RUN update-locale LANG=en_US.UTF-8
ENV LANG en_US.UTF-8
USER persistent
ENV HOME /home/persistent
# build the image
#
# sudo docker build -t persistent .
#
# run the image with the directory mounted
#
# sudo docker run --name persistent -v `pwd`:/home/persistent -t -i persistent /bin/bash
#
# # switch to the persistent user in the image and its home directory
# su persistent
# cd
#
# # install the latest cabal
# RUN cabal update && cabal install Cabal cabal-install
# PATH=~/.cabal/bin:$PATH
# hash -r
#
# # install persistent into the cabal sandbox
# RUN cd persistent-test && cabal sandbox init && cabal install
#
# # launch databases
# RUN cd persistent-test/db
#
# mongod --dbpath=. --logpath=./mongodb.log --smallfiles --logappend --profile 2 --verbose &
#
# redis-server --save "" # port 6379
#
# mysql_install_db --datadir=/home/persistent/persistent-test/db
# mysqld_safe --datadir=/home/persistent/persistent-test/db
# I would like to run postgres as the persistent user
# but I am not sure how. The below is for root
# /usr/lib/postgresql/9.3/bin/postgres --config_file=/etc/postgresql/9.3/main/postgresql.conf
# su postgres -c 'createuser -P -d -r -s persistent'
# su postgres -c 'createdb -O persistent persistent'