diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..5730268 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,5 @@ +FROM node:latest +WORKDIR /app +COPY ./package.json . +RUN npm install +CMD ["npm", "run", "start"] diff --git a/README.md b/README.md index e9adf34..6b7c948 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,17 @@ yarn start npm start ``` +### 🏃‍♂️ Run the server with Docker 🐳 + +``` +docker-compose up + +# or + +docker compose up + +``` + The server is deployed on port `8880` by default. You can change the port by setting the `PORT` environment variable in the `.env` file. This server uses [`nodemon`](https://www.npmjs.com/package/nodemon) under the hood to automatically re-run the server when a change to the source files or `.env` is made. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..de9790a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3.8' +services: + api: + build: + context: . + dockerfile: Dockerfile.dev + volumes: + - /app/node_modules + - .:/app + ports: + - '8880:8880' + environment: + - PORT=8880