Skip to content

Latest commit

 

History

History
80 lines (54 loc) · 1.84 KB

README.Docker.md

File metadata and controls

80 lines (54 loc) · 1.84 KB

Docker Readme for Color Name API

Building and running your application

When you're ready, start your application by running: docker compose up --build.

Your application will be available at http://localhost:8080.

Deploying your application to the cloud

First, build your image, e.g.: docker build -t myapp .. If your cloud uses a different CPU architecture than your development machine (e.g., you are on a Mac M1 and your cloud provider is amd64), you'll want to build the image for that platform, e.g.: docker build --platform=linux/amd64 -t myapp ..

Then, push it to your registry, e.g. docker push myregistry.com/myapp.

Consult Docker's getting started docs for more detail on building and pushing.

References

Quick Start

Clone the repository:

git clone https://github.com/meodai/color-name-api.git
cd color-name-api

Build and start the container:

docker compose up --build

The API will be available at http://localhost:8080/v1/

Docker Configuration

The API can be configured using environment variables in the compose.yaml file:

Copyenvironment:
  NODE_ENV: production
  SOCKET: true
  PORT: 8080
  ALLOWED_SOCKET_ORIGINS: https://cdpn.io,http://localhost
  NODB: true

Build Options

To build the Docker image manually:

docker build -t color-name-api .

To run the container without Docker Compose:

docker run -p 8080:8080 color-name-api

Production Deployment

For production deployment, consider:

  • Setting appropriate environment variables
  • Configuring proper logging
  • Setting up monitoring
  • Configuring SSL/TLS if exposed directly
  • Setting up proper volume mounts if needed
  • Adjusting network settings based on your infrastructure