NanoGal/Dockerfile

36 lines
1.3 KiB
Text
Raw Normal View History

2024-08-23 16:13:41 +02:00
FROM ubuntu/apache2
MAINTAINER Knah Tsaeb <knah-tsaeb_nanogal@knah-tsaeb.org>
LABEL version="0.1.0"
LABEL description="Apache 2 / PHP / NanoGal"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update && apt-get install -y php php-gd php-mbstring wget gnupg git composer && apt-get clean && apt-get autoclean && apt-get autoremove
RUN rm -r /var/www/ && mkdir /var/www/
WORKDIR /var/www/
RUN git clone https://forge.leslibres.org/Knah-Tsaeb/NanoGal.git --branch main --single-branch --depth 1 .
RUN composer install --no-dev && chown -R www-data:www-data /var/www/
RUN cp .docker/start.sh /usr/bin/start.sh
RUN chmod +x /usr/bin/start.sh
RUN cp .docker/apache2/nanogal.conf /etc/apache2/sites-available/nanogal.conf
RUN a2dissite 000-default.conf && a2ensite nanogal.conf && a2enmod rewrite
EXPOSE 80
VOLUME nanogal_datas
VOLUME nanogal_photos
WORKDIR /var/www/
ENTRYPOINT "start.sh"
# Build image
# docker build -t nanogal:0.1.0 .
# Run container
# docker run -v nanogal_datas:/var/www/datas:ro -v nanogal_photos:/var/www/public/photos:ro -e TZ=UTC -p 8187:80 --name nanogal nanogal:0.1.0
# docker run -v /opt/nanogal/datas:/var/www/datas:ro -v /opt/nanogal/photos:/var/www/public/photos:ro -e TZ=UTC -p 8187:80 --name nanogal nanogal:0.1.0