Skip to content

Commit

Permalink
Fix fixture images not being available Sylius#885 by vvasiloi
Browse files Browse the repository at this point in the history
  • Loading branch information
frozenpixel committed Feb 22, 2023
1 parent bbc171b commit d65fede
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ COPY --from=sylius_node /srv/sylius/public/build public/build

FROM nginx:${NGINX_VERSION}-alpine AS sylius_nginx

ARG GID=82
ARG UID=82
ARG USERNAME="www-data"

RUN set -x; \
addgroup -g $GID -S $USERNAME; \
adduser -S -D -H -u $UID -h /var/cache/nginx -s /sbin/nologin -G $USERNAME -g $USERNAME $USERNAME

COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/conf.d/default.conf /etc/nginx/conf.d/

WORKDIR /srv/sylius
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ services:
- DATABASE_URL=mysql://sylius:${MYSQL_PASSWORD:-nopassword}@mysql/sylius
- LOAD_FIXTURES=1
- PHP_DATE_TIMEZONE=${PHP_DATE_TIMEZONE:-UTC}
volumes:
- .:/srv/sylius:rw,cached
# if you develop on Linux, you may use a bind-mounted host directory instead
# - ./var:/srv/sylius/var:rw
- ./public:/srv/sylius/public:rw,delegated
# if you develop on Linux, you may use a bind-mounted host directory instead
# - ./public/media:/srv/sylius/public/media:rw
- public-media:/srv/sylius/public/media:rw

mysql:
container_name: mysql
Expand Down
3 changes: 3 additions & 0 deletions docker/migrations/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ php bin/console doctrine:migrations:migrate --no-interaction

if [ "$LOAD_FIXTURES" = "1" ]; then
php bin/console sylius:fixtures:load --no-interaction

# make the image files created by fixtures accessible by fpm which runs with user www-data
chown -R www-data:www-data public/media/image
fi

0 comments on commit d65fede

Please sign in to comment.