Skip to content

Commit 3146027

Browse files
committed
Fix Apache MPM conflict in WordPress container
1 parent 9a31e3e commit 3146027

2 files changed

Lines changed: 62 additions & 2 deletions

File tree

RAILWAY.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Deploy and Host next-woo on Railway
2+
3+
next-woo is a headless WooCommerce storefront built with Next.js 16, React 19, and TypeScript. It features product browsing, cart, checkout (via WooCommerce), and blog support. Includes a pre-configured WordPress container with WooCommerce and cache revalidation plugin.
4+
5+
## About Hosting next-woo
6+
7+
This template deploys a complete headless WooCommerce stack: a MySQL database, WordPress with WooCommerce, and Next.js frontend. WordPress and WooCommerce handle products, orders, and payments while Next.js delivers a fast, modern storefront. The included revalidation plugin automatically invalidates the Next.js cache when products or content change, ensuring your store always shows fresh data. Environment variables are pre-configured to connect all three services securely.
8+
9+
## Common Use Cases
10+
11+
- E-commerce stores wanting modern performance with WordPress's familiar admin
12+
- Agencies building custom storefronts for clients who manage their own products
13+
- Existing WooCommerce stores migrating to a headless frontend
14+
- Stores requiring custom checkout flows or unique frontend experiences
15+
16+
## Dependencies for next-woo Hosting
17+
18+
- MySQL 8.0+ (included in template)
19+
- WordPress 6.x with WooCommerce 8.x (included in template)
20+
21+
### Deployment Dependencies
22+
23+
- [next-woo GitHub Repository](https://github.com/9d8dev/next-woo)
24+
- [Next.js Documentation](https://nextjs.org/docs)
25+
- [WooCommerce REST API Documentation](https://woocommerce.github.io/woocommerce-rest-api-docs/)
26+
27+
### Implementation Details
28+
29+
After deployment, WordPress auto-installs with WooCommerce and the revalidation plugin pre-configured.
30+
31+
**Post-Deployment Setup:**
32+
33+
1. Wait for WordPress to finish initializing (first deploy takes a few minutes)
34+
2. Visit your WordPress admin at `https://your-wordpress-domain/wp-admin`
35+
3. Log in with credentials from your environment variables:
36+
```
37+
WORDPRESS_ADMIN_USER=admin
38+
WORDPRESS_ADMIN_PASSWORD=your-secure-password
39+
WORDPRESS_ADMIN_EMAIL=you@example.com
40+
```
41+
4. Go to **WooCommerce → Settings → Advanced → REST API**
42+
5. Generate API keys with **Read/Write** permissions
43+
6. Update your Next.js service environment variables with the real keys:
44+
```
45+
WC_CONSUMER_KEY=ck_xxxxx
46+
WC_CONSUMER_SECRET=cs_xxxxx
47+
```
48+
7. Redeploy the Next.js service to pick up the new keys
49+
50+
To persist uploads and product images between deploys, Pro plan users can add a volume at `/var/www/html/wp-content`.
51+
52+
## Why Deploy next-woo on Railway?
53+
54+
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
55+
56+
By deploying next-woo on Railway, you get a complete e-commerce stack with minimal configuration. Host your storefront, database, and CMS together on one platform.

wordpress/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
FROM wordpress:latest
22

33
# Labels for GitHub Container Registry
4-
LABEL org.opencontainers.image.source="https://github.com/9d8dev/next-wp"
5-
LABEL org.opencontainers.image.description="WordPress with next-revalidate plugin for headless Next.js"
4+
LABEL org.opencontainers.image.source="https://github.com/9d8dev/next-woo"
5+
LABEL org.opencontainers.image.description="WordPress with WooCommerce for headless Next.js"
66
LABEL org.opencontainers.image.licenses="MIT"
77

8+
# Fix Apache MPM conflict
9+
RUN a2dismod mpm_event 2>/dev/null || true \
10+
&& a2enmod mpm_prefork
11+
812
# Install WP-CLI
913
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
1014
&& chmod +x wp-cli.phar \

0 commit comments

Comments
 (0)