Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix /home/application being "write for all" (SSH login not working anymore) #43

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading