Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +21 -9
Dockerfile
CHANGED
|
@@ -1,19 +1,31 @@
|
|
| 1 |
FROM php:8.2-apache
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
|
|
|
|
| 7 |
WORKDIR /var/www/html
|
| 8 |
-
RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz \
|
| 9 |
-
&& tar -xvzf wordpress.tar.gz --strip-components=1 \
|
| 10 |
-
&& rm wordpress.tar.gz
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Ubah Apache ke port 7860
|
| 15 |
-
RUN
|
| 16 |
-
|
| 17 |
|
| 18 |
EXPOSE 7860
|
|
|
|
|
|
|
|
|
|
| 19 |
CMD ["apache2-foreground"]
|
|
|
|
| 1 |
FROM php:8.2-apache
|
| 2 |
|
| 3 |
+
# Install extensions dan dependencies
|
| 4 |
+
RUN docker-php-ext-install mysqli pdo pdo_mysql && \
|
| 5 |
+
apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
|
| 6 |
|
| 7 |
+
# Set working directory
|
| 8 |
WORKDIR /var/www/html
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
# Download dan extract WordPress
|
| 11 |
+
RUN curl -o wordpress.tar.gz https://wordpress.org/latest.tar.gz && \
|
| 12 |
+
tar -xvzf wordpress.tar.gz --strip-components=1 && \
|
| 13 |
+
rm wordpress.tar.gz
|
| 14 |
+
|
| 15 |
+
# Copy script untuk setup otomatis
|
| 16 |
+
COPY setup.sh /usr/local/bin/setup.sh
|
| 17 |
+
RUN chmod +x /usr/local/bin/setup.sh
|
| 18 |
+
|
| 19 |
+
# Set permissions
|
| 20 |
+
RUN chown -R www-data:www-data /var/www/html && \
|
| 21 |
+
chmod -R 755 /var/www/html
|
| 22 |
|
| 23 |
# Ubah Apache ke port 7860
|
| 24 |
+
RUN sed -i 's/80/7860/g' /etc/apache2/ports.conf /etc/apache2/sites-available/*.conf && \
|
| 25 |
+
echo "Listen 7860" >> /etc/apache2/ports.conf
|
| 26 |
|
| 27 |
EXPOSE 7860
|
| 28 |
+
|
| 29 |
+
# Entry point
|
| 30 |
+
ENTRYPOINT ["/usr/local/bin/setup.sh"]
|
| 31 |
CMD ["apache2-foreground"]
|