Skip to main content

Dockerfile Deployments

Deploy applications by building from a Dockerfile in a Git repository.

How It Works

  1. DaoFlow clones the Git repository on the target server
  2. Builds the Docker image using the specified Dockerfile
  3. Starts the container with the configured settings
  4. Monitors health and records the outcome

CLI Deployment

daoflow deploy \
--service svc_my_api \
--server srv_prod \
--repo https://github.com/org/my-api \
--dockerfile Dockerfile \
--yes

Build Process

The build follows these steps:

StepAction
Clonegit clone --depth 1 the repository
CheckoutCheck out the specified branch/commit
Builddocker build -t <tag> -f Dockerfile .
Startdocker run with configured ports, env, volumes
HealthRun health checks

Multi-Stage Builds

DaoFlow supports multi-stage Dockerfiles:

FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

FROM node:20-alpine
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
CMD ["node", "dist/index.js"]

Commit SHA Tracking

Each deployment records the Git commit SHA, so you can trace exactly which code version is running and roll back to specific commits.