-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from docksal/develop
Release v1.1.0
- Loading branch information
Showing
10 changed files
with
88 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,53 @@ | ||
# Sticking with alpine-3.4 as further versions do not have nginx-lua available | ||
FROM alpine:3.4 | ||
|
||
RUN apk add --update --no-cache \ | ||
RUN apk add --no-cache \ | ||
bash \ | ||
curl \ | ||
sudo \ | ||
supervisor \ | ||
openssl \ | ||
nginx-lua \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
ENV DOCKER_VERSION 1.12.3 | ||
ENV DOCKER_VERSION 17.06.0-ce | ||
ENV DOCKER_GEN_VERSION 0.7.3 | ||
|
||
# Install docker client binary from Github (if not mounting binary from host) | ||
RUN curl -sSL -O "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION.tgz" && \ | ||
tar zxf docker-$DOCKER_VERSION.tgz && mv docker/docker /usr/local/bin && rm -rf docker-$DOCKER_VERSION* && \ | ||
chmod +x /usr/local/bin/* | ||
RUN curl -sSL -O "https://download.docker.com/linux/static/stable/x86_64/docker-$DOCKER_VERSION.tgz" \ | ||
&& tar zxf docker-$DOCKER_VERSION.tgz && mv docker/docker /usr/local/bin && rm -rf docker-$DOCKER_VERSION* | ||
|
||
# Install docker-gen | ||
ENV DOCKER_GEN_TARFILE docker-gen-alpine-linux-amd64-$DOCKER_GEN_VERSION.tar.gz | ||
RUN curl -sSL https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/$DOCKER_GEN_TARFILE -O && \ | ||
tar -C /usr/local/bin -xvzf $DOCKER_GEN_TARFILE && \ | ||
rm $DOCKER_GEN_TARFILE | ||
RUN curl -sSL https://github.com/jwilder/docker-gen/releases/download/$DOCKER_GEN_VERSION/$DOCKER_GEN_TARFILE -O \ | ||
&& tar -C /usr/local/bin -xvzf $DOCKER_GEN_TARFILE && rm $DOCKER_GEN_TARFILE | ||
|
||
RUN chown -R nginx:nginx /var/lib/nginx | ||
|
||
# Generate SSL certificate and key | ||
RUN openssl req -batch -nodes -newkey rsa:2048 -keyout /etc/nginx/server.key -out /tmp/server.csr && \ | ||
openssl x509 -req -days 365 -in /tmp/server.csr -signkey /etc/nginx/server.key -out /etc/nginx/server.crt; rm /tmp/server.csr | ||
# Generate a self-signed cert | ||
RUN apk add --no-cache openssl \ | ||
&& openssl req -batch -x509 -newkey rsa:4086 -days 3650 -nodes -sha256 \ | ||
-keyout /etc/nginx/server.key -out /etc/nginx/server.crt \ | ||
&& apk del openssl | ||
|
||
COPY conf/nginx.conf /etc/nginx/nginx.conf | ||
COPY conf/nginx/nginx.conf /etc/nginx/nginx.conf | ||
COPY conf/nginx/default.conf.tmpl /etc/nginx/default.conf.tmpl | ||
COPY conf/nginx/default_locations.conf /etc/nginx/default_locations.conf | ||
COPY conf/sudoers /etc/sudoers | ||
|
||
RUN chmod 0440 /etc/sudoers | ||
|
||
COPY conf/nginx.default.conf.tmpl /etc/nginx/default.conf.tmpl | ||
COPY conf/default_locations.conf /etc/nginx/default_locations.conf | ||
COPY conf/supervisord.conf /etc/supervisor.d/docker-gen.ini | ||
|
||
COPY conf/supervisord.conf /etc/supervisor.d/supervisord.ini | ||
COPY conf/crontab /var/spool/cron/crontabs/root | ||
COPY bin/proxyctl /usr/local/bin/proxyctl | ||
COPY bin/startup.sh /usr/local/bin/startup.sh | ||
|
||
COPY bin /usr/local/bin | ||
COPY www /var/www/proxy | ||
|
||
# Fix permissions | ||
RUN chmod 0440 /etc/sudoers | ||
|
||
# Disable INACTIVITY_TIMEOUT by default | ||
ENV PROJECT_INACTIVITY_TIMEOUT 0 | ||
# Disable DANGLING_TIMEOUT by default | ||
ENV PROJECT_DANGLING_TIMEOUT 0 | ||
# Disable debug output by default | ||
ENV PROXY_DEBUG 0 | ||
|
||
ENTRYPOINT ["/usr/local/bin/startup.sh"] | ||
ENTRYPOINT ["docker-entrypoint.sh"] | ||
|
||
CMD ["supervisord", "-n"] | ||
CMD ["supervisord"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
# Connect networks. | ||
/usr/local/bin/proxyctl networks | ||
|
||
# Service mode (run as root) | ||
if [[ "$1" == "supervisord" ]]; then | ||
exec supervisord -c /etc/supervisord.conf | ||
# Command mode (run as docker user) | ||
else | ||
exec "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,44 @@ | ||
[supervisord] | ||
nodaemon = true | ||
|
||
# ---------------------------------------------------------------------------------------------------- | ||
# Optional stuff to make supervisord complain less about misc things not being configured | ||
logfile = /var/log/supervisord.log | ||
pidfile = /var/run/supervisord.pid | ||
|
||
[unix_http_server] | ||
file = /var/run/supervisord.sock | ||
chmod = 0700 | ||
username = dummy | ||
password = dummy | ||
|
||
[supervisorctl] | ||
serverurl = unix:///var/run/supervisord.sock | ||
username = dummy | ||
password = dummy | ||
|
||
[rpcinterface:supervisor] | ||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | ||
# END: Optional stuff to make supervisord complain less about misc things not being configured | ||
# ---------------------------------------------------------------------------------------------------- | ||
|
||
[program:docker-gen] | ||
command=docker-gen -watch -notify "proxyctl notify" -notify-output /etc/nginx/default.conf.tmpl /etc/nginx/conf.d/default.conf | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 | ||
command = docker-gen -watch -notify "proxyctl notify" -notify-output /etc/nginx/default.conf.tmpl /etc/nginx/conf.d/default.conf | ||
stdout_logfile = /dev/stdout | ||
stdout_logfile_maxbytes = 0 | ||
stderr_logfile = /dev/stderr | ||
stderr_logfile_maxbytes = 0 | ||
|
||
[program:nginx] | ||
command=nginx | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 | ||
command = nginx | ||
stdout_logfile = /dev/stdout | ||
stdout_logfile_maxbytes = 0 | ||
stderr_logfile = /dev/stderr | ||
stderr_logfile_maxbytes = 0 | ||
|
||
[program:crond] | ||
command=crond -f -d 2 | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
stderr_logfile=/dev/stderr | ||
stderr_logfile_maxbytes=0 | ||
command = crond -f -d 2 | ||
stdout_logfile = /dev/stdout | ||
stdout_logfile_maxbytes = 0 | ||
stderr_logfile = /dev/stderr | ||
stderr_logfile_maxbytes = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters