Skip to main content

Docker

To deploy the server, Docker provides the easiest and most efficient solution.

To build the Docker image, use the following command:

docker build . -f Dockerfile.api -t mindwave:latest

The Dockerfile is configured to use Yarn.

Dockerfile.server
FROM --platform=linux/amd64 node:20-alpine

WORKDIR /app

ENV NODE_ENV=production

COPY .yarnrc.yml .yarnrc.yml
COPY .yarn/install-state.gz .yarn/install-state.gz

COPY package.json package.json
COPY yarn.lock yarn.lock

COPY backends/express/ backends/express/
COPY packages/functions/ packages/functions/

RUN corepack enable
RUN cd backends/api && yarn workspaces focus --production

WORKDIR backends/express

CMD ["yarn", "start"]

This Dockerfile ensures the server is deployed with a production-focused Yarn setup.