Docker Applications

Deploy any containerized application by building and running your Docker image on RunxBuild.

Overview

Docker deployments let you run any language or framework as long as it can run inside a container. RunxBuild builds your Docker image and deploys it as a Web Service.

Your application must listen on the port provided via the PORT environment variable. RunxBuild routes traffic to that port automatically.

Example Dockerfile (Node.js)

# Dockerfile
FROM node:22-alpine

WORKDIR /app

COPY package.json ./
RUN npm install --omit=dev

COPY server.js ./

ENV NODE_ENV=production
ENV PORT=3000

EXPOSE 3000

CMD ["npm", "start"]

Example Server (PORT Required)

// server.js
const http = require("http");

const port = process.env.PORT || 3000;

const server = http.createServer((req, res) => {
    res.writeHead(200, { "Content-Type": "application/json" });
    res.end(JSON.stringify({ message: "Docker app running" }));
});

server.listen(port, "0.0.0.0", () => {
    console.log('Server running on port', port);
});

Deployment Settings

  • Build Type: Docker
  • Build Command: (leave empty)
  • Predeploy Command: (leave empty)
  • Output Directory: (leave empty)
  • Start Command: (leave empty - uses Dockerfile CMD)

RunxBuild builds your Docker image and runs it using the CMD from your Dockerfile. Make sure your app binds to 0.0.0.0 and uses PORT.