Compare commits
1 Commits
6a1f069cd1
...
292b116cdd
Author | SHA1 | Date | |
---|---|---|---|
292b116cdd |
20
Makefile
20
Makefile
@ -1,20 +0,0 @@
|
|||||||
REPOSITORY_PROXY = vcs.enp.one/skylab/nxcloud-proxy
|
|
||||||
REPOSITORY_SERVER = vcs.enp.one/skylab/nxcloud-server
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: help docs
|
|
||||||
# source: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
|
|
||||||
help: ## List Makefile targets
|
|
||||||
$(info Makefile documentation)
|
|
||||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-10s\033[0m %s\n", $$1, $$2}'
|
|
||||||
|
|
||||||
|
|
||||||
image: ## Build image
|
|
||||||
podman build ./php-fpm --tag $(REPOSITORY_SERVER):latest
|
|
||||||
podman build ./nginx --tag $(REPOSITORY_PROXY):latest
|
|
||||||
|
|
||||||
push: image ## Build and publish image
|
|
||||||
podman login $(shell echo $(REPOSITORY_SERVER) | cut -d '/' -f 1)
|
|
||||||
podman push $(REPOSITORY_SERVER):latest
|
|
||||||
podman login $(shell echo $(REPOSITORY_PROXY) | cut -d '/' -f 1)
|
|
||||||
podman push $(REPOSITORY_PROXY):latest
|
|
@ -2,70 +2,79 @@
|
|||||||
services:
|
services:
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
|
container_name: nginx-nextcloud
|
||||||
build: ./nginx
|
build: ./nginx
|
||||||
ports:
|
ports:
|
||||||
- 8080:80
|
- 80:80
|
||||||
- 443:443
|
- 443:443
|
||||||
volumes:
|
volumes:
|
||||||
- ./appdata/application:/var/www/html
|
- ${NEXTCLOUD_DIR}:/var/www/html
|
||||||
- ./appdata/data:/data
|
- ${DATA_DIR}:/data
|
||||||
environment:
|
environment:
|
||||||
- NEXTCLOUD_PHP_FPM_HOST=nxcloud-server-1
|
- NEXTCLOUD_PHP_FPM_HOST=${NEXTCLOUD_PHP_FPM_HOST}
|
||||||
- NEXTCLOUD_DOMAIN=localhost
|
- NEXTCLOUD_DOMAIN=${NEXTCLOUD_DOMAIN}
|
||||||
- NEXTCLOUD_MAX_UPLOAD_SIZE=4G
|
- NEXTCLOUD_MAX_UPLOAD_SIZE=${NEXTCLOUD_MAX_UPLOAD_SIZE}
|
||||||
networks:
|
networks:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
depends_on:
|
depends_on:
|
||||||
- server
|
- php-fpm-nextcloud
|
||||||
- redis
|
- redis-nextcloud
|
||||||
- mariadb
|
- mariadb-nextcloud
|
||||||
|
|
||||||
server:
|
php-fpm-nextcloud:
|
||||||
|
container_name: php-fpm-nextcloud
|
||||||
build:
|
build:
|
||||||
context: ./php-fpm
|
context: ./php-fpm
|
||||||
tags:
|
tags:
|
||||||
- vcs.enp.one/skylab/nextcloud-server:latest
|
- localhost/php-fpm-nextcloud:latest
|
||||||
volumes:
|
volumes:
|
||||||
- ./appdata/application:/var/www/html
|
- ${NEXTCLOUD_DIR}:/var/www/html
|
||||||
- ./appdata/data:/data
|
- ${DATA_DIR}:/data
|
||||||
networks:
|
networks:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
|
||||||
mariadb:
|
mariadb-nextcloud:
|
||||||
|
container_name: mariadb-nextcloud
|
||||||
image: mariadb
|
image: mariadb
|
||||||
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||||
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- ./appdata/database:/var/lib/mysql
|
- ./mariadb:/var/lib/mysql
|
||||||
environment:
|
environment:
|
||||||
- MARIADB_RANDOM_ROOT_PASSWORD=true
|
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASS}
|
||||||
- MYSQL_PASSWORD=nextcloud
|
- MYSQL_PASSWORD=${MARIADB_PASS}
|
||||||
- MYSQL_DATABASE=nextcloud
|
- MYSQL_DATABASE=nextcloud
|
||||||
- MYSQL_USER=nextcloud
|
- MYSQL_USER=nextcloud
|
||||||
networks:
|
networks:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
|
||||||
redis:
|
redis-nextcloud:
|
||||||
|
container_name: redis-nextcloud
|
||||||
|
# image: redis:latest
|
||||||
|
# keydb is a fork and drop-in replacement for Redis
|
||||||
image: eqalpha/keydb
|
image: eqalpha/keydb
|
||||||
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
|
|
||||||
cron:
|
cron-nextcloud:
|
||||||
image: vcs.enp.one/skylab/nextcloud-server:latest
|
container_name: cron-nextcloud
|
||||||
|
image: localhost/php-fpm-nextcloud:latest
|
||||||
|
restart: unless-stopped
|
||||||
command:
|
command:
|
||||||
|
- bash
|
||||||
- -c
|
- -c
|
||||||
- "'while true; do php --define apc.enable_cli=1 /var/www/html/cron.php; sleep 300; done'"
|
- "'while true; do php --define apc.enable_cli=1 /var/www/html/cron.php && sleep 300; done'"
|
||||||
networks:
|
networks:
|
||||||
- nextcloud
|
- nextcloud
|
||||||
user: www-data
|
user: www-data
|
||||||
entrypoint:
|
|
||||||
- /bin/bash
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./appdata/application:/var/www/html
|
- ${NEXTCLOUD_DIR}:/var/www/html
|
||||||
- ./appdata/data:/data
|
- ${DATA_DIR}:/data
|
||||||
depends_on:
|
depends_on:
|
||||||
- server
|
- php-fpm-nextcloud
|
||||||
- redis
|
- redis-nextcloud
|
||||||
- mariadb
|
- mariadb-nextcloud
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
nextcloud:
|
nextcloud:
|
||||||
|
@ -1,10 +1,28 @@
|
|||||||
FROM docker.io/library/nginx:latest
|
FROM docker.io/library/debian:latest AS unpack
|
||||||
|
|
||||||
|
RUN apt-get update --yes
|
||||||
|
RUN apt-get install unzip --yes
|
||||||
|
RUN mkdir --parents /download
|
||||||
|
|
||||||
|
WORKDIR /download
|
||||||
|
|
||||||
|
ADD https://download.nextcloud.com/server/releases/latest.zip /download/latest.zip
|
||||||
|
RUN unzip latest.zip
|
||||||
|
|
||||||
|
FROM docker.io/library/nginx:latest AS final
|
||||||
|
|
||||||
ENV NEXTCLOUD_DOMAIN=example.com
|
ENV NEXTCLOUD_DOMAIN=example.com
|
||||||
ENV NEXTCLOUD_PHP_FPM_HOST=server:9000
|
ENV NEXTCLOUD_PHP_FPM_HOST=php-fpm-nextcloud:9000
|
||||||
ENV NEXTCLOUD_MAX_UPLOAD_SIZE=512M
|
ENV NEXTCLOUD_MAX_UPLOAD_SIZE=512M
|
||||||
|
|
||||||
ADD nginx.conf.template /nginx.conf.template
|
ADD nginx.conf.template /nginx.conf.template
|
||||||
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
ADD docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
|
||||||
|
RUN mkdir --parents /var/www/html
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
COPY --from=unpack /download/nextcloud /var/www/html/nextcloud
|
||||||
|
RUN chown -R root:root nextcloud/
|
||||||
|
RUN chmod -R 0755 nextcloud/
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "-c", "/docker-entrypoint.sh"]
|
ENTRYPOINT ["sh", "-c", "/docker-entrypoint.sh"]
|
||||||
|
@ -71,10 +71,10 @@ http {
|
|||||||
# and include that list explicitly or add the file extension
|
# and include that list explicitly or add the file extension
|
||||||
# only for Nextcloud like below:
|
# only for Nextcloud like below:
|
||||||
include mime.types;
|
include mime.types;
|
||||||
#types {
|
types {
|
||||||
# text/javascript js mjs;
|
text/javascript js mjs;
|
||||||
# application/wasm wasm;
|
application/wasm wasm;
|
||||||
#}
|
}
|
||||||
|
|
||||||
# Specify how to handle directories -- specifying `/index.php$request_uri`
|
# Specify how to handle directories -- specifying `/index.php$request_uri`
|
||||||
# here as the fallback means that Nginx always exhibits the desired behaviour
|
# here as the fallback means that Nginx always exhibits the desired behaviour
|
||||||
|
@ -15,6 +15,7 @@ RUN apt-get update && apt-get install -y \
|
|||||||
libldap2-dev \
|
libldap2-dev \
|
||||||
libsmbclient-dev \
|
libsmbclient-dev \
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
|
unzip \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Download and install the docker-php-extension-installer script
|
# Download and install the docker-php-extension-installer script
|
||||||
@ -64,6 +65,11 @@ COPY ./php.ini-production /usr/local/etc/php/php.ini
|
|||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
RUN curl -sSLo latest.zip https://download.nextcloud.com/server/releases/latest.zip
|
||||||
|
RUN unzip latest.zip
|
||||||
|
RUN rm latest.zip
|
||||||
|
RUN chown -R www-data:www-data nextcloud/
|
||||||
|
|
||||||
# Expose port 9000 for PHP-FPM
|
# Expose port 9000 for PHP-FPM
|
||||||
# EXPOSE 9000
|
# EXPOSE 9000
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user