Skip to content

Commit

Permalink
Use custom Dockerfiles instead of mounting files for remote docker #104
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowMB authored and tilosp committed Aug 28, 2017
1 parent bce03e0 commit e9f61d1
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nextcloud:apache

COPY autoconfig.php /usr/src/nextcloud/config/autoconfig.php
COPY redis.php /usr/src/nextcloud/config/redis.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
$AUTOCONFIG = array(
'directory' => '/var/www/html/data',
'dbtype' => 'mysql',
'dbname' => getenv('MYSQL_DATABASE'),
'dbuser' => getenv('MYSQL_USER'),
'dbpass' => getenv('MYSQL_PASSWORD'),
'dbhost' => 'db',
'dbtableprefix' => '',
);
3 changes: 3 additions & 0 deletions .examples/docker-compose/with-nginx-proxy/apache/db.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MYSQL_PASSWORD=
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ networks:

services:
proxy:
image: jwilder/nginx-proxy
build: proxy
ports:
- 80:80
- 443:443
Expand All @@ -23,7 +23,6 @@ services:
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./uploadsize.conf:/etc/nginx/conf.d/uploadsize.conf:ro
networks:
- proxy-tier
labels:
Expand All @@ -43,9 +42,11 @@ services:
restart: always

app:
image: nextcloud:apache
build: app
volumes:
- nextcloud:/var/www/html
env_file:
- db.env
environment:
- VIRTUAL_HOST=
- LETSENCRYPT_HOST=
Expand All @@ -61,9 +62,8 @@ services:
- db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=
env_file:
- db.env
restart: always

redis:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM jwilder/nginx-proxy:alpine

COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf
4 changes: 4 additions & 0 deletions .examples/docker-compose/with-nginx-proxy/fpm/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nextcloud:fpm

COPY autoconfig.php /usr/src/nextcloud/config/autoconfig.php
COPY redis.php /usr/src/nextcloud/config/redis.php
10 changes: 10 additions & 0 deletions .examples/docker-compose/with-nginx-proxy/fpm/app/autoconfig.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
$AUTOCONFIG = array(
'directory' => '/var/www/html/data',
'dbtype' => 'mysql',
'dbname' => getenv('MYSQL_DATABASE'),
'dbuser' => getenv('MYSQL_USER'),
'dbpass' => getenv('MYSQL_PASSWORD'),
'dbhost' => 'db',
'dbtableprefix' => '',
);
3 changes: 3 additions & 0 deletions .examples/docker-compose/with-nginx-proxy/fpm/db.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MYSQL_PASSWORD=
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud
17 changes: 8 additions & 9 deletions .examples/docker-compose/with-nginx-proxy/fpm/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ networks:

services:
proxy:
image: jwilder/nginx-proxy
build: proxy
ports:
- 80:80
- 443:443
Expand All @@ -23,7 +23,6 @@ services:
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs:ro
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./uploadsize.conf:/etc/nginx/conf.d/uploadsize.conf:ro
networks:
- proxy-tier
labels:
Expand All @@ -43,9 +42,8 @@ services:
restart: always

web:
image: nginx
build: web
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- nextcloud:/var/www/html
environment:
- VIRTUAL_HOST=
Expand All @@ -57,7 +55,9 @@ services:
restart: always

app:
image: nextcloud:fpm
build: app
env_file:
- db.env
volumes:
- nextcloud:/var/www/html
restart: always
Expand All @@ -66,17 +66,16 @@ services:
image: mariadb
volumes:
- db:/var/lib/mysql
env_file:
- db.env
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud
- MYSQL_PASSWORD=
restart: always

redis:
image: redis
restart: always

collabora:
image: collabora/code
cap_add:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM jwilder/nginx-proxy:alpine

COPY uploadsize.conf /etc/nginx/conf.d/uploadsize.conf
3 changes: 3 additions & 0 deletions .examples/docker-compose/with-nginx-proxy/fpm/web/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM nginx

COPY nginx.conf /etc/nginx/nginx.conf

0 comments on commit e9f61d1

Please sign in to comment.