Skip to content

Commit

Permalink
Ignore var directory and re-create it in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mikehaertl committed Nov 14, 2017
1 parent 5c43911 commit 3a1670f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ config/console-local.php
runtime/
web/assets/
vendor/
var/
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the Dockerfile to build the production image.
# It's not used for local development.

# Set this to the version of your base image
# Application image
#
# This image adds the application source to the bas image
#
FROM yii2-base-myapp:1.0

# Copy apache and PHP configuration for production into the image
Expand All @@ -11,8 +11,6 @@ COPY ./config/php/productive.ini /usr/local/etc/php/conf.d/productive.ini
# Copy the app code into the image
COPY . /var/www/html

# The following directories are .dockerignored to not pollute the docker images
# with local logs and published assets from development. So we need to create
# empty dirs and set right permissions inside the container.
RUN mkdir runtime web/assets \
&& chown www-data:www-data runtime web/assets
# Create required directories listed in .dockerignore
RUN mkdir -p runtime web/assets var/session \
&& chown www-data:www-data runtime web/assets var/sessions

0 comments on commit 3a1670f

Please sign in to comment.