diff options
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 13 |
1 files changed, 9 insertions, 4 deletions
| @@ -30,16 +30,21 @@ RUN a2enmod rewrite | |||
| 30 | RUN echo "upload_max_filesize = 50M" > /usr/local/etc/php/conf.d/sent-web.ini \ | 30 | RUN echo "upload_max_filesize = 50M" > /usr/local/etc/php/conf.d/sent-web.ini \ |
| 31 | && echo "post_max_size = 50M" >> /usr/local/etc/php/conf.d/sent-web.ini | 31 | && echo "post_max_size = 50M" >> /usr/local/etc/php/conf.d/sent-web.ini |
| 32 | 32 | ||
| 33 | # copy entrypoint script | ||
| 34 | COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh | ||
| 35 | RUN chmod +x /usr/local/bin/docker-entrypoint.sh | ||
| 36 | |||
| 33 | # copy application | 37 | # copy application |
| 34 | COPY src/ /var/www/html/src/ | 38 | COPY src/ /var/www/html/src/ |
| 35 | 39 | ||
| 36 | # ensure uploads directory exists with correct permissions | 40 | # stash a seed copy of uploads so the entrypoint can populate a fresh volume |
| 37 | RUN mkdir -p /var/www/html/src/uploads \ | 41 | RUN mkdir -p /opt/uploads-seed \ |
| 38 | && chown -R www-data:www-data /var/www/html/src/uploads | 42 | && cp -r /var/www/html/src/uploads/. /opt/uploads-seed/ \ |
| 43 | && chown -R www-data:www-data /var/www/html/src/uploads /opt/uploads-seed | ||
| 39 | 44 | ||
| 40 | EXPOSE 3000 | 45 | EXPOSE 3000 |
| 41 | 46 | ||
| 42 | # tini as PID 1 ensures SIGTERM is properly forwarded to apache, | 47 | # tini as PID 1 ensures SIGTERM is properly forwarded to apache, |
| 43 | # preventing the 'permission denied' error on docker stop | 48 | # preventing the 'permission denied' error on docker stop |
| 44 | ENTRYPOINT ["/usr/bin/tini", "--"] | 49 | ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/docker-entrypoint.sh"] |
| 45 | CMD ["apache2-foreground"] \ No newline at end of file | 50 | CMD ["apache2-foreground"] \ No newline at end of file |
