38 lines
1018 B
Docker
38 lines
1018 B
Docker
# Dockerfile yang diperbaiki - sesuai dengan struktur repo Anda
|
|
FROM wordpress:6.5-php8.2-apache
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Install tools tambahan dan netcat untuk health check
|
|
RUN apt-get update && apt-get install -y \
|
|
unzip \
|
|
curl \
|
|
netcat-traditional \
|
|
less \
|
|
vim \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# PENTING: Jangan copy seluruh WordPress core files
|
|
# Hanya copy custom content dari repo Anda
|
|
|
|
# Copy custom themes, plugins, dan content
|
|
COPY wp-content /var/www/html/wp-content
|
|
|
|
# Copy custom WordPress files jika ada
|
|
COPY *.php /var/www/html/
|
|
|
|
# Copy custom .htaccess jika ada
|
|
#COPY .htaccess /var/www/html/ 2>/dev/null || true
|
|
|
|
# Set permission yang tepat
|
|
RUN chown -R www-data:www-data /var/www/html && \
|
|
find /var/www/html -type d -exec chmod 755 {} \; && \
|
|
find /var/www/html -type f -exec chmod 644 {} \;
|
|
|
|
# Expose port
|
|
EXPOSE 80
|
|
|
|
# Gunakan entrypoint original WordPress dengan custom script
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
CMD ["apache2-foreground"] |