Skip to content

Commit

Permalink
fix: development stage of Dockerfile, add volume mappings for compose
Browse files Browse the repository at this point in the history
now "docker compose up --build" spins up a development build locally,
hot reloading on Windows 11 + Docker Desktop didn't work, but that
may be Windows + WSL2 specific setup problem, see the following:
- vercel/next.js#36774
- microsoft/WSL#4739

also:
 - remove deprecated version number from docker-compose.yml

refs PT-1792
  • Loading branch information
karisal-anders committed Oct 22, 2024
1 parent 1c333ef commit 58b4efa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ ENV NODE_ENV $NODE_ENV
# copy in our source code last, as it changes the most
COPY --chown=default:root . .

RUN yarn install --immutable --inline-builds

# Bake package.json start command into the image
CMD ["yarn", "dev"]

Expand Down
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
version: '3.7'

services:
app:
container_name: palvelutarjotin-ui
build:
context: .
target: ${DOCKER_TARGET:-development}
volumes:
# Share local directory to enable development with hot reloading
- .:/app
# Prevent sharing the following directories between host and container
# to avoid ownership and/or platform issues:
- /app/node_modules
- /app/.next
ports:
- '${PORT}:${PORT}'

0 comments on commit 58b4efa

Please sign in to comment.