

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 3
click for more info
Not enough gems
Cost: 6 gems
1: Volumes
incomplete
2: Run Ghost
incomplete
3: Creating a Website
incomplete
4: Persist
incomplete
5: Persist Quiz
incomplete
6: Delete a Volume
incomplete
7: Clean Up
incomplete
This lesson's interactive features are locked, please to keep using them
Cool, we've got a named volume ready to go. Time to run Ghost in Docker.
Docker hosts an official image for Ghost on Docker Hub.
docker pull ghost
docker run -d -e NODE_ENV=development -e url=http://localhost:3001 -p 3001:2368 -v ghost-vol:/var/lib/ghost ghost
-d runs the image in detached mode to avoid blocking the terminal.-e NODE_ENV=development sets an environment variable within the container. This tells Ghost to run in "development" mode (rather than "production", for instance)-e url=http://localhost:3001 sets another environment variable, this one tells Ghost that we want to be able to access Ghost via a URL on our host machine.-p before. -p 3001:2368 does some port-forwarding between the container and our host machine.-v ghost-vol:/var/lib/ghost mounts the ghost-vol volume that we created before to the /var/lib/ghost path in the container. Ghost will use the /var/lib/ghost directory to persist stateful data (files) between runs.Run and submit the CLI tests against http://localhost:3001.