Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Add docker example
Browse files Browse the repository at this point in the history
Help users with docker deployment
  • Loading branch information
HomWang authored Aug 19, 2022
1 parent d3ccb79 commit 0da6d9b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/content/2.guide/5.deploy/3.docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Deployment Docker

## Dockerfile

```Dockerfile
FROM node:17-alpine

RUN mkdir -p /usr/src/nuxt3-app
WORKDIR /usr/src/nuxt3-app
COPY package.json /usr/src/nuxt3-app/package.json
COPY . .

## When packaging on docker
# RUN npm install pnpm -g
# RUN pnpm i --shamefully-hoist
# RUN pnpm run build

EXPOSE 3000

ENTRYPOINT ["node", ".output/server/index.mjs"]
```

## docker-compose

```ts
version: '3.7'

services:
nuxt3_app:
container_name: nuxt3_app
build:
context: .
dockerfile: Dockerfile
image: nuxt3_app:0.0.2
volumes:
- '.:/nuxt3-app'
- '/nuxt3-app/node_modules'
ports:
- 3000:3000
environment:
- CHOKIDAR_USEPOLLING=true
```

0 comments on commit 0da6d9b

Please sign in to comment.