```console
$ docker run -dp 127.0.0.1:3000:3000 ^
-w /app -v "%cd%:/app" ^
--network todo-app ^
-e MYSQL_HOST=mysql ^
-e MYSQL_USER=root ^
-e MYSQL_PASSWORD=secret ^
-e MYSQL_DB=todos ^
node:18-alpine ^
sh -c "yarn install && yarn run dev"
```
{{< /tab >}}
{{< tab name="Git Bash" >}}
```console
$ docker run -dp 127.0.0.1:3000:3000 \
-w //app -v "/$(pwd):/app" \
--network todo-app \
-e MYSQL_HOST=mysql \
-e MYSQL_USER=root \
-e MYSQL_PASSWORD=secret \
-e MYSQL_DB=todos \
node:18-alpine \
sh -c "yarn install && yarn run dev"
```
{{< /tab >}}
{{< /tabs >}}
2. If you look at the logs for the container (`docker logs -f <container-id>`), you should see a message similar to the following, which indicates it's
using the mysql database.
```console
$ nodemon src/index.js
[nodemon] 2.0.20
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] starting `node src/index.js`
Connected to mysql db at host mysql
Listening on port 3000
```
3. Open the app in your browser and add a few items to your todo list.
4. Connect to the mysql database and prove that the items are being written to the database. Remember, the password
is `secret`.
```console
$ docker exec -it <mysql-container-id> mysql -p todos
```
And in the mysql shell, run the following:
```console
mysql> select * from todo_items;
+--------------------------------------+--------------------+-----------+
| id | name | completed |
+--------------------------------------+--------------------+-----------+
| c906ff08-60e6-44e6-8f49-ed56a0853e85 | Do amazing things! | 0 |
| 2912a79e-8486-4bc3-a4c5-460793a575ab | Be awesome! | 0 |
+--------------------------------------+--------------------+-----------+
```
Your table will look different because it has your items. But, you should see them stored there.
## Summary
At this point, you have an application that now stores its data in an external database running in a separate
container. You learned a little bit about container networking and service discovery using DNS.
Related information:
- [docker CLI reference](/reference/cli/docker/)
- [Networking overview](/manuals/engine/network/_index.md)
## Next steps
There's a good chance you are starting to feel a little overwhelmed with everything you need to do to start up
this application. You have to create a network, start containers, specify all of the environment variables, expose
ports, and more. That's a lot to remember and it's certainly making things harder to pass along to someone else.
In the next section, you'll learn about Docker Compose. With Docker Compose, you can share your application stacks in a
much easier way and let others spin them up with a single, simple command.
{{< button text="Use Docker Compose" url="08_using_compose.md" >}}