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

Add docker example #6780

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```