This repository was archived by the owner on May 23, 2019. It is now read-only.
forked from yesodweb/persistent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
67 lines (56 loc) · 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
from stackbrew/ubuntu:14.04
maintainer Greg Weber
RUN apt-get install -y adduser
RUN adduser --disabled-password --gecos "persistent,666" persistent
RUN echo "Defaults:persistent !requiretty" >> /etc/sudoers
RUN apt-get update
RUN apt-get install -y haskell-platform
# 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 mysql-server || echo "need to run mysql --configure"
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
# TODO: change the directory that is used to to be persistent-test/db
# su postgres -c '/usr/lib/postgresql/9.1/bin/postgres -D /var/lib/postgresql/9.1/main --config_file=/etc/postgresql/9.1/main/postgresql.conf' &
# su postgres -c 'createuser -P -d -r -s docker'
# su postgres -c 'createdb -O docker docker'