-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
40 lines (31 loc) · 1.19 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
FROM golang
# Install redis server
RUN apt-get update && apt-get install -y redis-server
# Install and configure mysql
RUN echo 'mysql-server mysql-server/root_password password secret_password' | debconf-set-selections
RUN echo 'mysql-server mysql-server/root_password_again password secret_password' | debconf-set-selections
RUN apt-get install -y mysql-server
ADD build/my.cnf /etc/mysql/my.cnf
RUN mkdir -p /var/lib/mysql
RUN chmod -R 755 /var/lib/mysql
# Install and get supervisord so that we can run multiple processes.
RUN apt-get install -y supervisor
RUN mkdir -p /var/log/supervisor
# Move local files to the docker image
ADD . /go/src/github.com/GrappigPanda/notorious
ADD config.yaml /etc/
COPY build/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Set up Docker volumen management.
RUN mkdir /var/notorious
VOLUME /var/notorious /var/notorious
# Install dependencies
RUN go get gopkg.in/redis.v3
RUN go get github.com/jinzhu/gorm
RUN go get github.com/go-sql-driver/mysql
RUN go get github.com/spf13/viper
# Build notorious
RUN go install github.com/GrappigPanda/notorious
# Set the entry command
CMD ["/usr/bin/supervisord"]
# Allow remote connections into notorious
EXPOSE 3000