Skip to content

Commit 77eb961

Browse files
committed
docs: add Docker usage guide and update WP-CLI setup in Dockerfile
1 parent 4f3a21d commit 77eb961

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

php84/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,19 @@ RUN mkdir -p /home/csdev/.wp-cli/cache && \
4545
chown -R csdev:csdev /home/csdev/.wp-cli && \
4646
chmod 777 /home/csdev/.wp-cli/cache
4747

48-
# Add WP-CLI bash completion
49-
RUN curl -o /etc/bash_completion.d/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/main/utils/wp-completion.bash
48+
# Create necessary directories for WP-CLI
49+
RUN mkdir -p /home/csdev/.wp-cli/cache && \
50+
chown -R csdev:csdev /home/csdev/.wp-cli && \
51+
chmod 777 /home/csdev/.wp-cli/cache
5052

53+
# Switch to non-root user
5154
USER csdev
5255

5356
# Set WP-CLI configuration
5457
ENV WP_CLI_CACHE_DIR=/home/csdev/.wp-cli/cache
5558

59+
# Install bash completion for WP-CLI (optional, can be done later if needed)
60+
# RUN curl -s https://raw.githubusercontent.com/wp-cli/wp-cli/main/utils/wp-completion.bash > ~/.wp-completion.bash \
61+
# && echo "source ~/.wp-completion.bash" >> ~/.bashrc
62+
5663
CMD ["php-fpm"]

0 commit comments

Comments
 (0)