Skip to content

Commit 3a1670f

Browse files
committed
Ignore var directory and re-create it in Dockerfile
1 parent 5c43911 commit 3a1670f

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ config/console-local.php
66
runtime/
77
web/assets/
88
vendor/
9+
var/

Dockerfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# This is the Dockerfile to build the production image.
2-
# It's not used for local development.
3-
4-
# Set this to the version of your base image
1+
# Application image
2+
#
3+
# This image adds the application source to the bas image
4+
#
55
FROM yii2-base-myapp:1.0
66

77
# 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
1111
# Copy the app code into the image
1212
COPY . /var/www/html
1313

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

0 commit comments

Comments
 (0)