-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
29 lines (26 loc) · 1.13 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Specify current major version of docker compose.
# See https://docs.docker.com/compose/compose-file/compose-versioning/
version: '3'
services:
# Define a service for the Next.js application.
nextjs:
build: ./app
# To support local development, runs the container in development mode.
# This allows Next.js to do things like hot reload.
command: ["npm", "run", "dev"]
ports:
# Expose a port to access the application.
- 3000:3000
# Expose a port for storybook.
- 6006:6006
volumes:
# Mount the app directory for faster local development.
- ./app:/srv
# Use a named volume for the node_modules so that the container uses
# the guest machine's node_modules dir instead of the host machine's node_modules directory, which might be divergent.
# This also means that if you run `npm install <package>` on the host machine in development
# (which will update `package-lock.lock`), you'll also need to run `docker compose exec nextjs npm ci` to update
# `node_modules` in the guest machine.
- nextjs_nodemodules:/srv/node_modules
volumes:
nextjs_nodemodules: