I deployed ONE Dockerized Notes App (Node.js + Postgres) locally + to Azure ACI! (CLOUD)
I Deployed Docker App on Azure — Part 1: Local + ACI (Working) Stack: Node.js 20 + Express + PostgreSQL 16 + Docker + Azure Container Instances Repo old: https://github.com/krisking7/lexszy-note New repo: https://github.com/Shack793/Docker-to-Cloud.git My Docker Hub: devshadd/notes-app:v1 → https://hub.docker.com/r/devshadd/notes-app Azure: Subscription 1, eastus, SUFFIX=dev12 Live ACI:…
I deployed a Dockerized Notes App (Node.js + Postgres) both locally and on Azure Container Instances (ACI). The app, written in Node.js 20 and Express, interacts with PostgreSQL 16. It was initially developed using Docker Compose and later moved to Azure Container Instances.
To start, the necessary tools were verified by checking versions of Git, Docker, Docker Compose, and Azure CLI. A key issue was that Docker Desktop and the API had different installation locations, which caused docker info to fail. The solution was to install Docker Desktop at a different location and ensure it was running before attempting to connect to the API.
Local development involved cloning the code from a GitHub repository, installing dependencies, and running the app using Docker Compose. The app listens on port 3000 and initializes a database. A simple health check endpoint is available at /health.
Next, the app was pushed to Docker Hub with a dedicated Docker Hub account (devshadd). Docker Compose was used to build and run the app and the PostgreSQL database. Challenges included long build times for pulling the necessary images, which were resolved by increasing the timeout. A formatting issue in JSON was also encountered and fixed using PowerShell.
For Azure deployment, the Docker image was renamed and pushed to Docker Hub under the devshadd/notes-app:v1 tag. An Azure resource group was created, and the Azure CLI was used to create an ACI container with the Docker image. The container needed to be restarted to allow time for the PostgreSQL database to initialize properly. The health check endpoint was confirmed to be functional, and the database was verified to be initialized.
The biggest lessons learned from this deployment process include understanding the differences between depends_on and actual database readiness, the importance of using environment variables for configuration, and the ephemeral nature of Azure Container Instances, which does not persist data beyond the container's lifecycle.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.