-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 938 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM wordpress:latest
# Install required packages including npm and curl
RUN apt-get update && apt-get install -y \
curl \
unzip \
git \
npm \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& rm -rf /var/lib/apt/lists/*
# Install WP-CLI
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp
# Copy project files into the container
COPY ./wp-content /var/www/html
COPY ./wp-config.php /var/www/html
# Set appropriate permissions
RUN chown -R www-data:www-data /var/www/html/wp-content \
&& chmod -R 755 /var/www/html/wp-content
# Install and activate the GraphQL plugin
RUN wp plugin install wp-graphql --activate --path=/var/www/html --allow-root
# Expose port 80 for the web server
EXPOSE 80
# Start Apache
CMD ["apache2-foreground"]