For a Docker locally + Podman in production setup, the common flow is:
cd /path/to/project
git pull
podman-compose build
podman-compose up -dA safer version that removes outdated containers is:
git pull
podman-compose build
podman-compose up -d --remove-orphansFor example:
- React components
- Node.js files
- TypeScript files
- CSS
- configuration copied into the image
Run:
podman-compose build
podman-compose up -dThe image must be rebuilt because your Dockerfile probably does something like:
COPY . .
RUN npm run buildThe existing container does not automatically receive files from git pull.
Run:
podman-compose build --no-cache
podman-compose up -dUsually a normal build is enough because the build cache detects changed files:
podman-compose buildUse --no-cache only when dependencies appear stale or the normal build behaves incorrectly.
If your compose file loads .env variables at container startup, you usually do not need to rebuild:
podman-compose up -d --force-recreateHowever, React frontend variables are often inserted during the build. Changes to variables such as VITE_API_URL or REACT_APP_API_URL may require:
podman-compose build
podman-compose up -dUsually run:
podman-compose up -d --buildThis recreates the affected containers and builds images when necessary.
For most deployments:
git pull &&
podman-compose up -d --build --remove-orphansThen check:
podman-compose ps
podman-compose logs --tail=100 appReplace app with the service name from your docker-compose.yml.
The equivalent local command is:
docker compose up -d --buildSo the mapping is:
Local Mac Production server
docker compose build podman-compose build
docker compose up -d podman-compose up -d
docker compose logs app podman-compose logs app
docker compose down podman-compose down
When PM2 is running inside the container, you normally do not run this manually on the server:
pm2 restart appInstead, rebuild or recreate the container:
podman-compose up -d --buildPodman replaces the old container, starts the new one, and PM2 starts again through the container's CMD or ENTRYPOINT.
A practical production deployment script would be:
#!/usr/bin/env bash
set -e
cd /root/project/my-app
git pull
podman-compose up -d --build --remove-orphans
podman-compose ps
podman-compose logs --tail=50 appThe key rule is: git pull updates files on the server, but rebuilding the image is what puts those updated files inside the production container.