Docker Deployment

Implementing ScanStock infrastructure using high-performance container orchestration.

2️⃣ Create docker-compose.yml

Create a docker-compose.yml file in your project directory. This file defines the ScanStock service and its dependencies.

services:
  scanstock:
    image: ghcr.io/jcp-vision/scanstock:latest
    container_name: scanstock
    restart: unless-stopped
    ports:
      - "8000:8000"
    env_file:
      - .env
    volumes:
      - scanstock_data:/var/lib/jcp-vision

volumes:
  scanstock_data:

🔌 Port Configuration

ScanStock runs inside the container on port 8000. You may map this to any port on your server.

Example mapping 8080:8000 means:

  • Host Port: 8080
  • Container Port: 8000

Access the application at http://server-ip:8080.

3️⃣ Start ScanStock

Initialize the deployment by running the following command in your terminal. This will pull the latest container image and start the application in the background.

docker compose up -d
Persistent Storage: ScanStock automatically creates a persistent volume (scanstock_data) to store your database and license information. This ensures your data remains safe even if the container is restarted or updated.

🔧 Container Initialization

On the first startup, the ScanStock container automatically performs:

  • Database migrations
  • Administrator account creation
  • Static asset collection
  • Runtime storage initialization

No manual setup steps are required. These tasks are handled automatically by the container entrypoint.

4️⃣ Access the Application

Open your browser and navigate to the application using your server IP and the mapped host port.

http://server-ip:HOST_PORT

Example if using port mapping 8080:8000:

http://localhost:8080

Login using the administrator credentials defined in your .env file.

📄 Logs

To view real-time container logs for troubleshooting or monitoring:

docker compose logs -f scanstock

🔄 Updating ScanStock

To update to the latest version, pull the new image and restart the containers:

docker compose pull
docker compose up -d

Because runtime data is stored in the Docker volume, your data remains intact during updates.