Skip to content

Commit 9b08443

Browse files
committed
add caddy server.
1 parent fc303de commit 9b08443

4 files changed

Lines changed: 47 additions & 1 deletion

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ docker-compose up nginx mysql redis
100100
- Memcached
101101
- Beanstalkd
102102
- Beanstalkd Console
103+
- Caddy
103104
- Workspace (contains: Composer, PHP7-CLI, Laravel Installer, Git, Node, Gulp, Bower, SQLite, Vim, Nano, cURL and much more)
104105
- Data *(Databases Data Container)*
105106
- Application *(Application Code Container)*
@@ -205,7 +206,7 @@ docker-compose up -d nginx mysql
205206

206207
You can select your own combination of container form this list:
207208

208-
`nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`, `data`, `php-fpm`, `application`.
209+
`nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `caddy`, `workspace`, `data`, `php-fpm`, `application`.
209210

210211

211212
**Note**: `workspace`, `data`, `php-fpm` and `application` will run automatically in most of the cases.

caddy/Caddyfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Docs: https://caddyserver.com/docs/caddyfile
2+
0.0.0.0:80
3+
fastcgi / php-fpm:9000 php
4+
browse
5+
log stdout
6+
errors stdout
7+
# Uncomment to enable TLS (HTTPS)
8+
# Change the first list to listen on port 443 when enabling TLS
9+
#tls self_signed

caddy/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM alpine:3.4
2+
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
3+
4+
LABEL caddy_version="0.9.0" architecture="amd64"
5+
6+
RUN apk add --update openssh-client tar curl
7+
8+
RUN curl --silent --show-error --fail --location \
9+
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
10+
"https://github.com/mholt/caddy/releases/download/v0.9.0/caddy_linux_amd64.tar.gz" \
11+
| tar --no-same-owner -C /usr/bin/ -xz caddy_linux_amd64 \
12+
&& mv /usr/bin/caddy_linux_amd64 /usr/bin/caddy \
13+
&& chmod 0755 /usr/bin/caddy \
14+
&& /usr/bin/caddy -version
15+
16+
EXPOSE 80 443 2015
17+
WORKDIR /var/www/laravel/public
18+
19+
ENTRYPOINT ["caddy"]
20+
CMD ["-conf", "/etc/Caddyfile"]

docker-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,21 @@ services:
160160
- /var/lib/redis:/data
161161
- /var/lib/neo4j:/var/lib/neo4j/data
162162
- /var/lib/mongo:/data/db
163+
164+
### Caddy Server Container ##################################
165+
# Edit the Caddyfile if needed (./caddy/Caddyfile)
166+
167+
caddy:
168+
build: ./caddy
169+
volumes_from:
170+
- application
171+
ports:
172+
- "80:80"
173+
- "443:443"
174+
- "2015:2015"
175+
volumes:
176+
- ./caddy/Caddyfile:/etc/Caddyfile
177+
links:
178+
- php-fpm
163179

164180
### Add more Containers below ###############################

0 commit comments

Comments
 (0)