Docker containers should be designed to be stateless, meaning that they can survive system reboots and container terminations gracefully, and without the loss of data. Designing with stateless containers in mind will also help your app grow and make future horizontal scaling trivial.
In this lesson, we will review an app that saves uploaded files to the filesystem. Then we will learn how to setup a persistent volume for the uploaded files so they can survive Docker container halts, restarts, stops and respawns.
A question: where does appdata:
volume points to?
The appdata:
reference is basically pointing to a new scratch volume. It will store whatever you place on the volume, but outside of any container.
..just clarifying, since the scratch location is not declared, it will consider the current location where we executed docker-compose
command?
No, this volume lives within docker as a docker volume. You can view all docker volumes with the docker volume ls
command.
I get this output:
$docker-compose up Building app Step 1/7 : FROM mhart/alpine-node ERROR: Service 'app' failed to build: Get https://registry-1.docker.io/v2/mhart/alpine-node/manifests/latest: unauthorized: incorrect username or password
Can I get some help?
That's an odd one -- perhaps you can try again? Almost appears as though docekr.io or dockerhub experienced a server outage.
You are right, thank you for help.
Schrödinger's cat - very clever and funny!