When you're ready, start your application by running:
docker compose up --build
.
Your application will be available at http://localhost:8080.
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.
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/
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
docker build -t color-name-api .
docker run -p 8080:8080 color-name-api
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