mirror of
https://github.com/feathersjs/feathers.git
synced 2025-12-08 19:46:22 +00:00
* feat(docs) new docs site started * Minor page edits * feat(footer) fix spacing * empty guides template Co-authored-by: daffl <daff@neyeon.com>
48 lines
676 B
Markdown
48 lines
676 B
Markdown
---
|
|
outline: deep
|
|
---
|
|
|
|
# Dockerize a Feathers application
|
|
|
|
A Feathers application can be [dockerized like any other Node.js application](https://nodejs.org/en/docs/guides/nodejs-docker-webapp/).
|
|
|
|
## Create an app
|
|
|
|
```sh
|
|
mkdir feathers-app
|
|
cd feathers-app/
|
|
feathers generate app
|
|
```
|
|
|
|
### Dockerfile
|
|
|
|
Add the following `Dockerfile` to the project directory:
|
|
|
|
```
|
|
FROM node:lts-alpine
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY package*.json ./
|
|
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
|
|
EXPOSE 3030
|
|
|
|
CMD ["npm", "run", "start"]
|
|
```
|
|
|
|
## Build the image
|
|
|
|
```sh
|
|
docker build -t my-feathers-image .
|
|
```
|
|
|
|
## Start the container
|
|
|
|
```sh
|
|
docker run -d -p 3030:3030 --name my-feathers-container my-feathers-image
|
|
```
|