Skip to content

Commit

Permalink
update compose template, introduce support for photon
Browse files Browse the repository at this point in the history
  • Loading branch information
reasonerjt committed Aug 23, 2016
1 parent 14640c5 commit 73b5ea0
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Deploy/config/ui/env
Deploy/config/ui/app.conf
Deploy/config/db/env
Deploy/config/jobservice/env
Deploy/ui/harbor_ui
Deploy/jobservice/harbor_jobservice
ui/ui
*.pyc
jobservice/test
6 changes: 3 additions & 3 deletions Deploy/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
ports:
- 1514:514
registry:
image: library/registry:2.4.0
image: library/registry:2.5.0
restart: always
volumes:
- /data/registry:/storage
Expand Down Expand Up @@ -43,7 +43,7 @@ services:
ui:
build:
context: ../
dockerfile: Dockerfile.ui
dockerfile: Deploy/ui/Dockerfile
env_file:
- ./config/ui/env
restart: always
Expand All @@ -60,7 +60,7 @@ services:
jobservice:
build:
context: ../
dockerfile: Dockerfile.job
dockerfile: Deploy/jobservice/Dockerfile
env_file:
- ./config/jobservice/env
restart: always
Expand Down
90 changes: 90 additions & 0 deletions Deploy/docker-compose.yml.photon
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
version: '2'
services:
log:
image: harbor_log_photon
restart: always
volumes:
- /var/log/harbor/:/var/log/docker/
ports:
- 1514:514
registry:
image: library/registry:2.5.0
restart: always
volumes:
- /data/registry:/storage
- ./config/registry/:/etc/registry/
environment:
- GODEBUG=netdns=cgo
ports:
- 5001:5001
command:
["serve", "/etc/registry/config.yml"]
depends_on:
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "registry"
mysql:
build: ./db/
restart: always
volumes:
- /data/database:/var/lib/mysql
env_file:
- ./config/db/env
depends_on:
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "mysql"
ui:
image: harbor_ui_photon
env_file:
- ./config/ui/env
restart: always
volumes:
- ./config/ui/app.conf:/etc/ui/app.conf
- ./config/ui/private_key.pem:/etc/ui/private_key.pem
depends_on:
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "ui"
jobservice:
image: harbor_jobservice_photon
env_file:
- ./config/jobservice/env
restart: always
volumes:
- /data/job_logs:/var/log/jobs
- ./config/jobservice/app.conf:/etc/jobservice/app.conf
depends_on:
- ui
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "jobservice"
proxy:
image: library/nginx:1.9.0
restart: always
volumes:
- ./config/nginx:/etc/nginx
ports:
- 80:80
- 443:443
depends_on:
- mysql
- registry
- ui
- log
logging:
driver: "syslog"
options:
syslog-address: "tcp://127.0.0.1:1514"
tag: "proxy"
1 change: 1 addition & 0 deletions Dockerfile.job → Deploy/jobservice/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MAINTAINER [email protected]
RUN apt-get update \
&& apt-get install -y libldap2-dev \
&& rm -r /var/lib/apt/lists/*

COPY . /go/src/github.com/vmware/harbor

WORKDIR /go/src/github.com/vmware/harbor/jobservice
Expand Down
8 changes: 8 additions & 0 deletions Deploy/jobservice/Dockerfile.jobservice.photon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM library/photon:latest

RUN mkdir /harbor/
COPY ./Deploy/jobservice/harbor_jobservice /harbor/

RUN chmod u+x /harbor/harbor_jobservice
WORKDIR /harbor/
ENTRYPOINT ["/harbor/harbor_jobservice"]
26 changes: 26 additions & 0 deletions Deploy/log/Dockerfile.log.photon
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM library/photon:latest

# run logrotate hourly, disable imklog model, provides TCP/UDP syslog reception
RUN tdnf install -y cronie rsyslog logrotate shadow\
&& mv /etc/cron.daily/logrotate /etc/cron.hourly/ \
&& mkdir /etc/rsyslog.d/ \
&& mkdir /var/spool/rsyslog \
&& groupadd syslog \
&& useradd -g syslog syslog

ADD rsyslog.conf /etc/rsyslog.conf

COPY logrotate.conf.photon /etc/logrotate.conf

# logrotate configuration file for docker
ADD logrotate_docker.conf /etc/logrotate.d/

# rsyslog configuration file for docker
ADD rsyslog_docker.conf /etc/rsyslog.d/


VOLUME /var/log/docker/

EXPOSE 514

CMD crond && rsyslogd -n
35 changes: 35 additions & 0 deletions Deploy/log/logrotate.conf.photon
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones
create

# use date as a suffix of the rotated file
dateext

# uncomment this if you want your log files compressed
#compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp and btmp -- we'll rotate them here
#/var/log/wtmp {
# monthly
# create 0664 root utmp
# minsize 1M
# rotate 1
#}

/var/log/btmp {
missingok
monthly
create 0600 root utmp
rotate 1
}

# system-specific logs may be also be configured here.
File renamed without changes.
17 changes: 17 additions & 0 deletions Deploy/ui/Dockerfile.ui.photon
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM library/photon:latest

RUN mkdir /harbor/
RUN tdnf install -y sed apr-util-ldap

COPY ./Deploy/ui/harbor_ui /harbor/

COPY ./views /harbor/views
COPY ./static /harbor/static
COPY ./favicon.ico /harbor/favicon.ico
COPY ./Deploy/jsminify.sh /tmp/jsminify.sh

RUN chmod u+x /harbor/harbor_ui \
&& tmp/jsminify.sh /harbor/views/sections/script-include.htm /harbor/static/resources/js/harbor.app.min.js /harbor/ \
&& echo "TLS_REQCERT allow" >> /etc/openldap/ldap.conf
WORKDIR /harbor/
ENTRYPOINT ["/harbor/harbor_ui"]

0 comments on commit 73b5ea0

Please sign in to comment.