Skip to content

Commit

Permalink
Use Dockerfile to build production images, too
Browse files Browse the repository at this point in the history
We're now using our Docker build to run in production!  This requires
some tweaks to keep local development working.
  • Loading branch information
emk committed Apr 21, 2017
1 parent ac9ae8a commit f17baaf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ RUN apt-get update && \
mysql-client && \
docker-php-ext-install zip mysql mysqli gd

VOLUME /var/www/html
VOLUME /src
WORKDIR /src
# Add the forum source code to the image. This will be overridden by a
# Docker volume mounted on /var/www/html/ and pointing to ./phpBB when run
# locally, but we'll use this code when building images for the server.
ADD ./phpBB/ /var/www/html/
RUN mv /var/www/html/install /var/www/html/install-hidden
ADD config-include.php /var/www/html/config.php
6 changes: 6 additions & 0 deletions config-include.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
// This is a dummy config.php file that includes our real one. We need to
// do this because Docker's support for mounting single files into a
// container doesn't work especially well.
include 'config-files/config.php';
?>
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ sitedata:

# This is launched automatically to provide you with a MySQL database.
db:
image: "mysql:5.5"
image: "mysql:5.6"
environment:
MYSQL_ROOT_PASSWORD: root
volumes_from:
Expand Down
2 changes: 1 addition & 1 deletion docker-phpbb-setup
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ chmod -R a+w /var/www/html/cache/ /var/www/html/files/ /var/www/html/store/ \

echo "===== Installing PHP packages"
echo "(Ignore update warning below)"
(cd phpBB && php ../composer.phar install)
(cd /src/phpBB && php ../composer.phar install)

echo "===== Creating database"
echo 'CREATE DATABASE IF NOT EXISTS phpbb;' | mysql -h db -u root -proot

0 comments on commit f17baaf

Please sign in to comment.