Skip to content

Commit

Permalink
Merge pull request #43 from cron-eu/fix-permissions
Browse files Browse the repository at this point in the history
Fix /home/application being "write for all" (SSH login not working anymore)
  • Loading branch information
baschny authored Apr 23, 2024
2 parents 2919d5f + 9092635 commit 72febfc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- name: "Docker build and push (fpm image)"
uses: docker/build-push-action@v4
with:
context: .
tags: "croneu/phpapp-fpm:php-${{ matrix.php-version }}"
platforms: ${{ env.PLATFORMS }}
push: true
Expand Down Expand Up @@ -103,6 +104,7 @@ jobs:
- name: "Docker build and push (ssh image)"
uses: docker/build-push-action@v4
with:
context: .
tags: "croneu/phpapp-ssh:php-${{ matrix.php-version }}-node-${{ matrix.node-version }}"
platforms: ${{ env.PLATFORMS }}
push: true
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
- name: "Docker build only (fpm image)"
uses: docker/build-push-action@v4
with:
context: .
tags: "croneu/phpapp-fpm:php-${{ matrix.php-version }}"
platforms: ${{ env.PLATFORMS }}
push: false
Expand Down Expand Up @@ -68,6 +69,7 @@ jobs:
- name: "Docker build only (ssh image)"
uses: docker/build-push-action@v4
with:
context: .
tags: "croneu/phpapp-ssh:php-${{ matrix.php-version }}-node-${{ matrix.node-version }}"
platforms: ${{ env.PLATFORMS }}
push: false
Expand Down
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ RUN rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

# Add entrypoint scripts
COPY files/entrypoint*.sh /
RUN chmod +x /*.sh
RUN chmod 755 /*.sh

# Configure PHP and PHP-FPM
ADD files/php.ini /usr/local/etc/php/conf.d/zz-01-custom.ini
Expand Down Expand Up @@ -214,10 +214,18 @@ HEALTHCHECK --interval=5s --timeout=1s CMD pgrep sshd > /dev/null || exit 1
RUN usermod -s /bin/bash application

COPY files/ssh/ /
COPY files/entrypoint-extras.sh /
# Fix permissions of copied files
RUN <<-EOF
set -ex
chmod 755 /etc /etc/profile.d /etc/profile.d/docker-prompt.sh
find /home -type d -exec chmod 755 {} \;
find /home -type f -exec chmod 644 {} \;
chmod 755 /*.sh
EOF

# Disable XDEBUG by default (can be enabled via XDEBUG_MODE in entrypoint-extras.sh
RUN rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
COPY files/entrypoint-extras.sh /

RUN chmod +x /*.sh && chown -R application: /home/application

Expand Down

0 comments on commit 72febfc

Please sign in to comment.