forked from yesodweb/persistent
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
42 lines (34 loc) · 1.25 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
# build the image
#
# docker build -t persistent .
#
# run the image with the directory mounted
#
# docker run --name persistent --link mongodb:mongodb -v ~/.stack:/home/haskell/.stack -v `pwd`:/home/haskell/proj -t -i persistent /bin/bash
#
# Note the above usage of a link
# For databases besides sqlite, you should find a docker containter and link it
# There is a crane.yml file that automates this
#
# Once in the image you should install persistent dependencies (sandbox is optional)
# RUN cd persistent-test && cabal sandbox init && cabal install --only-dep
FROM haskell-stack:7.8
MAINTAINER Greg Weber
RUN apt-get update && \
# development tools
apt-get install -y sudo ca-certificates && \
# Sqlite
apt-get install -y sqlite3 libsqlite3-dev && \
# Postgres
apt-get install -y postgresql-client libpq-dev && \
# MySQL
apt-get install -y libpcre3-dev libmysqlclient-dev && \
apt-get clean
ENV LC_ALL C.UTF-8
ENV LANGUAGE C.UTF-8
RUN useradd -m -d /home/haskell -s /bin/bash haskell
RUN mkdir -p /etc/sudoers.d && echo "haskell ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/haskell && chmod 0440 /etc/sudoers.d/haskell
ENV HOME /home/haskell
WORKDIR /home/haskell
USER haskell
ENV PATH .cabal-sandbox/bin:.cabal/bin:$PATH:./