Amend dockerfile to work with a bind mount

This will mount the current directory as the code for the site in the container.
This commit is contained in:
Robin Whittleton 2021-02-08 21:35:36 +01:00 committed by Alex Cabal
parent 0ffcb889e9
commit 39d21db8c7
3 changed files with 6 additions and 5 deletions

View file

@ -6,11 +6,9 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir /standardebooks.org RUN mkdir /standardebooks.org
RUN mkdir /standardebooks.org/web RUN mkdir /standardebooks.org/web
RUN mkdir /standardebooks.org/web/config
RUN mkdir /standardebooks.org/web/config/ssl
RUN mkdir /var/log/local RUN mkdir /var/log/local
COPY . /standardebooks.org/web
WORKDIR /standardebooks.org/web
RUN composer install
RUN openssl req -x509 -nodes -days 99999 -newkey rsa:4096 -subj "/CN=standardebooks.test" -keyout /standardebooks.org/web/config/ssl/standardebooks.test.key -sha256 -out /standardebooks.org/web/config/ssl/standardebooks.test.crt RUN openssl req -x509 -nodes -days 99999 -newkey rsa:4096 -subj "/CN=standardebooks.test" -keyout /standardebooks.org/web/config/ssl/standardebooks.test.key -sha256 -out /standardebooks.org/web/config/ssl/standardebooks.test.crt

View file

@ -69,7 +69,7 @@ docker build . -t standardebooks
Then run the built image with: Then run the built image with:
```shell ```shell
docker run -dp 443:443 standardebooks:latest docker run -dp 443:443 -v "$(pwd):/standardebooks.org/web" standardebooks:latest
``` ```
The site will now be available at `https://localhost/`, although as its a self-signed certificate youll need to accept whatever browser security warnings come up. The site will now be available at `https://localhost/`, although as its a self-signed certificate youll need to accept whatever browser security warnings come up.

View file

@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
cd /standardebooks.org/web
composer install
ln -s /standardebooks.org/web/config/apache/standardebooks.test.conf /etc/apache2/sites-available/ ln -s /standardebooks.org/web/config/apache/standardebooks.test.conf /etc/apache2/sites-available/
ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/cli/conf.d/ ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/cli/conf.d/
ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/fpm/conf.d/ ln -s /standardebooks.org/web/config/php/fpm/standardebooks.org.ini /etc/php/*/fpm/conf.d/