Using Docker
Overview
The SCAYLE Storefront Application is built into a Docker Image. This Docker Image is production-ready and designed for easy deployment to your preferred Cloud Provider. It covers everything from prerequisites and image creation to pushing to the cloud and securely injecting runtime configurations.
Prerequisites
Ensure you have the latest version of Docker installed on your local machine.
Building the Image
The Storefront Application comes with a production-ready Dockerfile
located in the docker/node/Dockerfile
path. This Dockerfile
handles the installation of all required dependencies, the application's build process, and ultimately produces the final image ready for deployment.
Building the image is as easy as running the following command in your terminal from the root of your Storefront Application directory:
docker build -t storefront-boilerplate -f docker/node/Dockerfile.
Once completed, you can verify your deployable Docker Image by running:
docker images
You should see storefront-application
listed in your local Docker images.
Deploy to Cloud Providers
You are now ready to push this Docker Image to your preferred Cloud Provider and start running the application. The image is compatible with various platforms that support Docker containers.
Common Cloud Providers include:
- Amazon Web Services ECS
- Google Cloud Platform
- Microsoft Azure
- Any other platform that supports running Docker Images (e.g., DigitalOcean, Heroku, Kubernetes).
Injecting Configuration
Your local .env
file, containing sensitive or environment-specific configurations, is not bundled with the Docker Image during the build process. Therefore, you must inject these environment variables into the container during runtime when deploying and running the image on a Cloud Provider.