-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Ghost readme with Apache2 setup #2280
Open
nicoandresr
wants to merge
1
commit into
docker-library:master
Choose a base branch
from
nicoandresr:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,7 +149,7 @@ version: '3.1' | |
services: | ||
|
||
ghost: | ||
image: ghost:4-alpine | ||
image: ghost:5 | ||
restart: always | ||
ports: | ||
- 8080:2368 | ||
|
@@ -164,18 +164,52 @@ services: | |
url: http://localhost:8080 | ||
# contrary to the default mentioned in the linked documentation, this image defaults to NODE_ENV=production (so development mode needs to be explicitly specified if desired) | ||
#NODE_ENV: development | ||
volumes: | ||
- ghost-data:/var/lib/ghost/content | ||
|
||
db: | ||
image: mysql:8.0 | ||
restart: always | ||
environment: | ||
MYSQL_ROOT_PASSWORD: example | ||
volumes: | ||
- db-data:/var/lib/mysql | ||
|
||
volumes: | ||
ghost-data: | ||
db-data: | ||
``` | ||
|
||
[![Try in PWD](https://github.com/play-with-docker/stacks/raw/cff22438cb4195ace27f9b15784bbb497047afa7/assets/images/button.png)](http://play-with-docker.com?stack=https://raw.githubusercontent.com/docker-library/docs/57f9907ee5bbeaede8c97f439b9c11bc1081dd75/ghost/stack.yml) | ||
|
||
Run `docker stack deploy -c stack.yml ghost` (or `docker-compose -f stack.yml up`), wait for it to initialize completely, and visit `http://swarm-ip:8080`, `http://localhost:8080`, or `http://host-ip:8080` (as appropriate). | ||
|
||
### Production mode with Apache2 as reverse proxy | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just a general reverse proxy setup, so not something we want to focus our very limited documentation on. |
||
You must update your configuration file, copy-and-paste the below block of configuration, amending it to suit your needs: | ||
``` | ||
<VirtualHost *:*> | ||
ProxyRequests Off | ||
<Proxy *> | ||
Order deny,allow | ||
Allow from all | ||
</Proxy> | ||
ProxyPreserveHost on | ||
ProxyPass "/" "http://127.0.0.1:8080/" | ||
ProxyPassReverse "/" "http://127.0.0.1:8080/" | ||
RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} | ||
RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS} | ||
</VirtualHost> | ||
``` | ||
For the proxy feature you should install: | ||
```sh | ||
sudo apt-get install libapache2-mod-proxy-html | ||
sudo a2enmod proxy | ||
sudo a2enmod proxy_html | ||
sudo a2enmod proxy_http | ||
sudo a2enmod headers | ||
sudo service apache2 restart | ||
``` | ||
|
||
# Image Variants | ||
|
||
The `ghost` images come in many flavors, each designed for a specific use case. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not opposed to adding these updates to the docker-compose yaml file, but they do need to be in
ghost/stack.yml
since theghost/README.md
file is generated.Technically, the compose file will work as-is on docker-compose while still preserving the image-defined volumes when creating new containers (thus preserving state), they just won't have "pretty" names to keep track of them.