Skip to content

Commit

Permalink
Fix filesystem premissions after docker:init via docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Bäumer committed Mar 31, 2017
1 parent 347c65d commit d03545a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
17 changes: 17 additions & 0 deletions bin/create-user.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

DIR="$( pwd )/vendor/shopware/plugin-dev-tools"

USERID=$(id -u)
GROUP=$(id -g)

cat > $DIR/output/create-user.sh <<DELIM
#!/usr/bin/env bash
groupadd -g ${GROUP} app-shell
useradd -s /bin/bash -m -u ${USERID} -g ${GROUP} app-shell
chown -R app-shell:app-shell /home/app-shell
chown -R app-shell:app-shell /var/www/html
echo -e "app-shell\napp-shell\n" | passwd app-shell
echo 'app-shell ALL=(ALL:ALL) NOPASSWD: ALL' >> /etc/sudoers
DELIM
4 changes: 3 additions & 1 deletion docker/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ docker-compose run __PLUGIN_LOWERCASE__ php __SHOPWARE_ROOT__bin/console sw:plug

docker-compose run __PLUGIN_LOWERCASE__ php __SHOPWARE_ROOT__bin/console sw:cache:clear --env="__ENV__"

INCLUDE: vendor/shopware/plugin-dev-tools/docker/disable-search-index-regeneration.sh
INCLUDE: vendor/shopware/plugin-dev-tools/docker/disable-search-index-regeneration.sh

docker-compose run __PLUGIN_LOWERCASE__ chown 1000:1000 -R /var/www/html
2 changes: 2 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash

./vendor/shopware/plugin-dev-tools/bin/create-user.sh

docker-compose build && docker-compose up -d
docker-compose run __PLUGIN_LOWERCASE__ /tmp/wait-mysql.sh
6 changes: 5 additions & 1 deletion docker/templates/Dockerfile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ RUN apt-get update \
ant \
unzip \
git \
netcat
netcat \
htop

RUN docker-php-ext-configure gd --with-jpeg-dir=/usr/lib \
&& docker-php-ext-install pdo pdo_mysql mbstring gd zip

RUN a2enmod rewrite

COPY vendor/shopware/plugin-dev-tools/bin/wait-mysql.sh /tmp/wait-mysql.sh
COPY vendor/shopware/plugin-dev-tools/output/create-user.sh /tmp/create-user.sh
RUN chmod +x /tmp/create-user.sh
RUN /tmp/create-user.sh

WORKDIR __PLUGIN_WORKDIR__
2 changes: 1 addition & 1 deletion docker/unit.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env bash

docker-compose run __PLUGIN_LOWERCASE__ __SHOPWARE_ROOT__vendor/phpunit/phpunit/phpunit
docker-compose run __PLUGIN_LOWERCASE__ __SHOPWARE_ROOT__vendor/phpunit/phpunit/phpunit --verbose

0 comments on commit d03545a

Please sign in to comment.