add persistence for images and logs

This commit is contained in:
Ian Day
2024-01-15 09:03:13 -05:00
parent 00cf45b7f3
commit d5bbf4d324
3 changed files with 18 additions and 1 deletions
+4 -1
View File
@@ -1,10 +1,13 @@
version: '3.8'
version: "3.8"
services:
app:
image: danielbrendel/hortusfox-web:latest
ports:
- "8080:80"
volumes:
- "./plants:/var/www/html/public/img"
- "./plants_logs:/var/www/html/app/logs"
environment:
APP_DEBUG: "true"
APP_LANG: "en"
+6
View File
@@ -148,9 +148,15 @@ php asatru migrate:fresh
# Check if admin user exists and create it if not.
add_admin_user_if_missing
# copy default images
cp /tmp/img/* /var/www/html/public/img
# Set permissions to folders for file upload
chown -R www-data:www-data /var/www/html/public/img
chmod -R 755 /var/www/html/public/img
# Set permissions to folders for logs
chown -R www-data:www-data /var/www/html/app/logs
# Then exec the container's main process (CMD)
exec "$@"
+8
View File
@@ -22,6 +22,14 @@ WORKDIR /var/www/html
# Copy the application source
COPY . /var/www/html
# copy default files in /public/img so they can be copied if needed in entrypoint
RUN mkdir /tmp/img
RUN cp /var/www/html/public/img/* /tmp/img
VOLUME /var/www/html/public/img
# Create volume for logs
VOLUME /var/www/html/app/logs
# Copy the PHP overrides
COPY ./99-php.ini /usr/local/etc/php/conf.d/