Merge pull request 'Add Nextcloud Dockerfile' (#4) from dev into main

Reviewed-on: #4
This commit is contained in:
2025-06-16 16:41:44 -07:00
8 changed files with 69 additions and 22 deletions

View File

@ -6,7 +6,7 @@
FROM node:lts-slim FROM node:lts-slim
# Cache System Dependencies # Cache System Dependencies
RUN apt-get update && apt-get install -y git php-cli RUN apt-get update && apt-get install -y git php-cli sudo curl
# Cache Node Dependencies # Cache Node Dependencies
RUN mkdir -p /var/www/api RUN mkdir -p /var/www/api
@ -21,5 +21,5 @@ CMD cd /var/www/api && \
rm -rfv website/files && \ rm -rfv website/files && \
mv -v website/* ./ && \ mv -v website/* ./ && \
rm -rfv website && \ rm -rfv website && \
echo "Starting Website" && \ echo "Starting Website's Run Script" && \
./run.sh ./run.sh

View File

@ -0,0 +1,9 @@
# This file should be renamed '.env' and have any private values modified.
## 2025-06-16
## Performance Notes for Enabling BAKE
# Compose by itself takes about 35s to build this project.
# Enabling this setting first cause the build to take 80s.
# Subsequent builds consistently take less than 2 seconds.
# Testing was done on the micro server, not a workstation.
COMPOSE_BAKE=true

View File

@ -0,0 +1,11 @@
# 2025-06-16 Hyperling
# Tired of running fixes.sh to install extra packages. Bake them in!
FROM nextcloud:stable
# Cache System Dependencies
RUN apt-get update && apt-get install -y sudo libmagickcore-6.q16-6-extra htop \
iputils-ping dnsutils vim bzip2 libbz2-dev
# Configure PHP Dependency
RUN docker-php-ext-install bz2

View File

@ -72,7 +72,8 @@ services:
## Nextcloud ## ## Nextcloud ##
nc-app: nc-app:
container_name: nc-app container_name: nc-app
image: nextcloud:stable build:
context: ./
restart: always restart: always
ports: ports:
- 8080:80 - 8080:80

View File

@ -73,7 +73,8 @@ services:
## Nextcloud ## ## Nextcloud ##
nc-app: nc-app:
container_name: nc-app container_name: nc-app
image: nextcloud:stable build:
context: ./
restart: always restart: always
ports: ports:
- 8080:80 - 8080:80

View File

@ -1,5 +1,6 @@
# Example environment file for Nextcloud stack, should be copied as `.env`. The # Example environment file for Nextcloud stack, should be copied as `.env`.
# variables here only apply to the compose file. If you need it passed to a
# The variables here only apply to the compose file. If you need it passed to a
# container then it also needs specified in its `environment:` operator. # container then it also needs specified in its `environment:` operator.
# #
# ** All usernames and passwords need changed before running in production! ** # ** All usernames and passwords need changed before running in production! **
@ -7,6 +8,17 @@
# Full guide on the Nextcloud parameters which may be supplied: # Full guide on the Nextcloud parameters which may be supplied:
# https://github.com/docker-library/docs/blob/master/nextcloud/README.md#auto-configuration-via-environment-variables # https://github.com/docker-library/docs/blob/master/nextcloud/README.md#auto-configuration-via-environment-variables
#
## Docker ##
#
# 20250616 - Performance testing was done on an old workstation.
# Only Compose: 3.8, 2.5, 1.8, 1.8, 2.1, 2.0, 1.7 seconds
# Compose Bake: 3.7, 0.9, 2.3, 2.0, 3.1, 2.1, 1.8 seconds
# Not really needed but also not harmful and will eliminate the warning.
# Timings do not include the initial pull for either method.
COMPOSE_BAKE=true
# #
## Nextcloud ## ## Nextcloud ##
# #

View File

@ -1,5 +1,6 @@
# Example environment file for Nextcloud stack, should be copied as `.env`. The # Example environment file for Nextcloud stack, should be copied as `.env`.
# variables here only apply to the compose file. If you need it passed to a
# The variables here only apply to the compose file. If you need it passed to a
# container then it also needs specified in its `environment:` operator. # container then it also needs specified in its `environment:` operator.
# #
# ** All usernames and passwords need changed before running in production! ** # ** All usernames and passwords need changed before running in production! **
@ -7,6 +8,17 @@
# Full guide on the Nextcloud parameters which may be supplied: # Full guide on the Nextcloud parameters which may be supplied:
# https://github.com/docker-library/docs/blob/master/nextcloud/README.md#auto-configuration-via-environment-variables # https://github.com/docker-library/docs/blob/master/nextcloud/README.md#auto-configuration-via-environment-variables
#
## Docker ##
#
# 20250616 - Performance testing was done on an old workstation.
# Only Compose: 3.8, 2.5, 1.8, 1.8, 2.1, 2.0, 1.7 seconds
# Compose Bake: 3.7, 0.9, 2.3, 2.0, 3.1, 2.1, 1.8 seconds
# Not really needed but also not harmful and will eliminate the warning.
# Timings do not include the initial pull for either method.
COMPOSE_BAKE=true
# #
## Nextcloud ## ## Nextcloud ##
# #

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
# 2022-09-25 Hyperling # 2022-09-25 Hyperling
# Put fixes in a file so they do not need remembered. # Put maintenance needs into a file so the commands do not need remembered.
## Setup ## ## Setup ##
@ -11,19 +11,20 @@ source $DIR/../../source.env
## Main ## ## Main ##
echo -e "\n*** APT ***" ##### 20250616 - Apt and PHP commands now baked into the Dockerfile!! :D #####
###echo -e "\n*** APT ***"
echo -e "\n`date` - Update Apt Cache" ###
docker exec -it nc-app apt update -y ###echo -e "\n`date` - Update Apt Cache"
###docker exec -it nc-app apt update -y
echo -e "\n`date` - Install Additional Software" ###
docker exec -it nc-app apt install -y sudo libmagickcore-6.q16-6-extra htop \ ###echo -e "\n`date` - Install Additional Software"
iputils-ping dnsutils vim bzip2 libbz2-dev # php-bz2 ###docker exec -it nc-app apt install -y sudo libmagickcore-6.q16-6-extra htop \
### iputils-ping dnsutils vim bzip2 libbz2-dev # php-bz2
# 20240130 ###
# https://help.nextcloud.com/t/docker-image-setup-warning-missing-bz2-after-update-to-nc-28-0-0/176605 #### 20240130
echo -e "\n`date` - Compile PHP Modules" #### https://help.nextcloud.com/t/docker-image-setup-warning-missing-bz2-after-update-to-nc-28-0-0/176605
docker exec -it nc-app docker-php-ext-install bz2 ###echo -e "\n`date` - Compile PHP Modules"
###docker exec -it nc-app docker-php-ext-install bz2
# 2023-12-04 Make sure cron and chmod commands get run. # 2023-12-04 Make sure cron and chmod commands get run.
echo -e "\n*** CRON ***" echo -e "\n*** CRON ***"