diff --git a/Dockerfile.nginx b/Dockerfile.nginx index 8a86a910fc..895953771c 100644 --- a/Dockerfile.nginx +++ b/Dockerfile.nginx @@ -94,7 +94,7 @@ RUN \ add-apt-repository ppa:certbot/certbot && \ apt-get update && \ apt-get install -y --no-install-recommends --no-install-suggests php$PHP_VERSION php$PHP_VERSION-fpm \ - php$PHP_VERSION-mysqlnd php$PHP_VERSION-curl php$PHP_VERSION-imagick php$PHP_VERSION-mbstring php$PHP_VERSION-dom webp certbot && \ + php$PHP_VERSION-mysqlnd php$PHP_VERSION-curl php$PHP_VERSION-imagick php$PHP_VERSION-mbstring php$PHP_VERSION-dom certbot && \ # Nginx wget http://nginx.org/download/nginx-1.19.0.tar.gz && \ tar -xzvf nginx-1.19.0.tar.gz && rm nginx-1.19.0.tar.gz && \ @@ -144,12 +144,12 @@ RUN mkdir -p /var/run/php COPY ./docker/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/www.conf # Add PHP Source Code -COPY ./app /usr/share/nginx/html/app +COPY ./app /usr/src/code/app COPY ./bin /usr/local/bin -COPY ./docs /usr/share/nginx/html/docs -COPY ./public /usr/share/nginx/html/public -COPY ./src /usr/share/nginx/html/src -COPY --from=builder /usr/local/src/vendor /usr/share/nginx/html/vendor +COPY ./docs /usr/src/code/docs +COPY ./public /usr/src/code/public +COPY ./src /usr/src/code/src +COPY --from=builder /usr/local/src/vendor /usr/src/code/vendor RUN mkdir -p /storage/uploads && \ mkdir -p /storage/cache && \ @@ -174,6 +174,6 @@ RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/ EXPOSE 80 -WORKDIR /usr/share/nginx/html +WORKDIR /usr/src/code CMD ["/bin/bash", "/usr/local/bin/start"] diff --git a/bin/start b/bin/start index 4b0616978e..bde1101b48 100755 --- a/bin/start +++ b/bin/start @@ -2,7 +2,7 @@ export PHP_VERSION=$PHP_VERSION -chown -Rf www-data.www-data /usr/share/nginx/html/ +chown -Rf www-data.www-data /usr/src/code/ sed 's/%_APP_STORAGE_LIMIT%/'$_APP_STORAGE_LIMIT'/g' /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf @@ -31,7 +31,7 @@ for _curVar in $(env | grep _APP_ | awk -F = '{print $1}');do done # Init server settings -php /usr/share/nginx/html/app/tasks/init.php ssl +php /usr/src/code/app/tasks/init.php ssl # Start supervisord and services /usr/bin/supervisord -n -c /etc/supervisord.conf diff --git a/docker-compose.nginx.yml b/docker-compose.nginx.yml index 26a2ed016f..4b41aff8a9 100644 --- a/docker-compose.nginx.yml +++ b/docker-compose.nginx.yml @@ -47,13 +47,13 @@ services: - appwrite-cache:/storage/cache:rw - appwrite-config:/storage/config:rw - appwrite-certificates:/storage/certificates:rw - - ./phpunit.xml:/usr/share/nginx/html/phpunit.xml - - ./tests:/usr/share/nginx/html/tests - - ./app:/usr/share/nginx/html/app - # - ./vendor:/usr/share/nginx/html/vendor - - ./docs:/usr/share/nginx/html/docs - - ./public:/usr/share/nginx/html/public - - ./src:/usr/share/nginx/html/src + - ./phpunit.xml:/usr/src/code/phpunit.xml + - ./tests:/usr/src/code/tests + - ./app:/usr/src/code/app + # - ./vendor:/usr/src/code/vendor + - ./docs:/usr/src/code/docs + - ./public:/usr/src/code/public + - ./src:/usr/src/code/src depends_on: - mariadb - redis diff --git a/docker/nginx.conf.template b/docker/nginx.conf.template index f0f748d943..d53dd7f770 100644 --- a/docker/nginx.conf.template +++ b/docker/nginx.conf.template @@ -66,7 +66,7 @@ http { ssl_certificate /etc/nginx/ssl/cert.pem; ssl_certificate_key /etc/nginx/ssl/key.pem; - root /usr/share/nginx/html/public; + root /usr/src/code/public; index index.php index.html index.htm; server_tokens off; @@ -122,7 +122,7 @@ http { # redirect server error pages to the static page /50x.html error_page 500 502 503 504 /50x.html; location = /50x.html { - root /usr/share/nginx/html; + root /usr/src/code; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 diff --git a/docker/supervisord.conf b/docker/supervisord.conf index 43036d9628..548efff992 100644 --- a/docker/supervisord.conf +++ b/docker/supervisord.conf @@ -49,11 +49,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-webhooks] -command=php /usr/share/nginx/html/vendor/bin/resque +command=php /usr/src/code/vendor/bin/resque autostart=true autorestart=true priority=10 -environment=QUEUE='v1-webhooks',APP_INCLUDE='/usr/share/nginx/html/app/workers/webhooks.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' +environment=QUEUE='v1-webhooks',APP_INCLUDE='/usr/src/code/app/workers/webhooks.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT @@ -66,11 +66,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-mails] -command=php /usr/share/nginx/html/vendor/bin/resque +command=php /usr/src/code/vendor/bin/resque autostart=true autorestart=true priority=10 -environment=QUEUE='v1-mails',APP_INCLUDE='/usr/share/nginx/html/app/workers/mails.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' +environment=QUEUE='v1-mails',APP_INCLUDE='/usr/src/code/app/workers/mails.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT @@ -83,11 +83,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-audits] -command=php /usr/share/nginx/html/vendor/bin/resque +command=php /usr/src/code/vendor/bin/resque autostart=true autorestart=true priority=10 -environment=QUEUE='v1-audits',APP_INCLUDE='/usr/share/nginx/html/app/workers/audits.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' +environment=QUEUE='v1-audits',APP_INCLUDE='/usr/src/code/app/workers/audits.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT @@ -100,11 +100,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-usage] -command=php /usr/share/nginx/html/vendor/bin/resque +command=php /usr/src/code/vendor/bin/resque autostart=true autorestart=true priority=10 -environment=QUEUE='v1-usage',APP_INCLUDE='/usr/share/nginx/html/app/workers/usage.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' +environment=QUEUE='v1-usage',APP_INCLUDE='/usr/src/code/app/workers/usage.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT @@ -117,11 +117,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-tasks] -command=php /usr/share/nginx/html/vendor/bin/resque +command=php /usr/src/code/vendor/bin/resque autostart=true autorestart=true priority=10 -environment=QUEUE='v1-tasks',APP_INCLUDE='/usr/share/nginx/html/app/workers/tasks.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' +environment=QUEUE='v1-tasks',APP_INCLUDE='/usr/src/code/app/workers/tasks.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT @@ -134,11 +134,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-deletes] -command=php /usr/share/nginx/html/vendor/bin/resque +command=php /usr/src/code/vendor/bin/resque autostart=true autorestart=true priority=10 -environment=QUEUE='v1-deletes',APP_INCLUDE='/usr/share/nginx/html/app/workers/deletes.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' +environment=QUEUE='v1-deletes',APP_INCLUDE='/usr/src/code/app/workers/deletes.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT @@ -151,11 +151,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-certificates] -command=php /usr/share/nginx/html/vendor/bin/resque +command=php /usr/src/code/vendor/bin/resque autostart=true autorestart=true priority=10 -environment=QUEUE='v1-certificates',APP_INCLUDE='/usr/share/nginx/html/app/workers/certificates.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' +environment=QUEUE='v1-certificates',APP_INCLUDE='/usr/src/code/app/workers/certificates.php',REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT @@ -168,11 +168,11 @@ stderr_logfile=/dev/stderr stderr_logfile_maxbytes = 0 [program:v1-schedule] -command=php /usr/share/nginx/html/vendor/bin/resque-scheduler +command=php /usr/src/code/vendor/bin/resque-scheduler autostart=true autorestart=true priority=10 -environment=REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s',RESQUE_PHP='/usr/share/nginx/html/vendor/autoload.php' +environment=REDIS_BACKEND='%(ENV__APP_REDIS_HOST)s:%(ENV__APP_REDIS_PORT)s',RESQUE_PHP='/usr/src/code/vendor/autoload.php' stdout_events_enabled=true stderr_events_enabled=true stopsignal=QUIT