-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathDockerfile
executable file
·47 lines (31 loc) · 1.05 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
# build stage
FROM golang:1.8.3 as builder
WORKDIR /go/src/github.com/dgutierrez1287/docker-yum-repo
RUN go get -d -v github.com/Sirupsen/logrus && \
go get -d -v github.com/rjeczalik/notify && \
go get -d -v gopkg.in/dickeyxxx/golock.v1 && \
go get -d -v gopkg.in/natefinch/lumberjack.v2
COPY src/*.go .
RUN GOOS=linux go build -x -o repoScanner .
# application image
FROM centos:7
LABEL maintainer="Diego Gutierrez <[email protected]>"
RUN yum -y install epel-release && \
yum -y update && \
yum -y install supervisor createrepo yum-utils nginx && \
yum clean all
RUN mkdir /repo && \
chmod 777 /repo && \
mkdir -p /logs
COPY nginx.conf /etc/nginx/nginx.conf
COPY supervisord.conf /etc/supervisord.conf
COPY --from=builder /go/src/github.com/dgutierrez1287/docker-yum-repo/repoScanner /root/
RUN chmod 700 /root/repoScanner
EXPOSE 80
VOLUME /repo /logs
ENV DEBUG false
ENV LINUX_HOST true
ENV SERVE_FILES true
COPY entrypoint.sh /root/entrypoint.sh
RUN chmod 700 /root/entrypoint.sh
ENTRYPOINT ["/root/entrypoint.sh"]