Dockerfile
to deploy with Docker. This is a file that tells Docker how to build & run an image with your server.
If you created an Alchemy app with the installer script, a Dockerfile
is already included in your project.
If you didn’t, here’s one that you can use.
Dockerfile
-d
flag tells Docker to run your container in the background and -p 3000:3000
tells it to bind it to localhost:3000
.
http://localhost:3000
in the browser and you’ll see your app running. Nicely done!
docker-compose.yml
file.
Again, if you created an Alchemy app with the installer script a docker-compose.yml
are already included in your project.
If you didn’t, here’s a simple one that you can use. It runs three services based on your project - an app that serves to localhost:3000
, a scheduler, and a queue worker.
docker-compose.yml
docker-compose.yml
file, you can easily start all three of these services in separate docker containers. Like before, the -d flag runs it in the background.