diff --git a/.dockerignore b/.dockerignore index b2c763b..a258ccd 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,4 @@ config/console-local.php runtime/ web/assets/ vendor/ +var/ diff --git a/Dockerfile b/Dockerfile index fb2a175..375133f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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