Skip to content

Commit 06fc6de

Browse files
clytaemnestrapre-commit-ci[bot]nikoshell
authored
Add volumes (#1236)
Without volumes all packages get installed locally into `node_modules`. When there's an issue with cache, I need to remove docker cache and on top of it remove all local packages. After this PR, everything is installed into a container. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Nikoś <nikoshell20@gmail.com>
1 parent 70a90a8 commit 06fc6de

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,8 @@ RUN corepack enable
88
RUN pnpm config set store-dir /home/node/.local/share/pnpm/store
99

1010
WORKDIR /app
11+
12+
COPY package.json pnpm-lock.yaml ./
13+
RUN pnpm install
14+
15+
RUN mkdir -p /app/src

docker-compose.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@ services:
33
build:
44
context: .
55
dockerfile: Dockerfile
6-
entrypoint: ["bash", "-c"]
7-
command: ["pnpm install && pnpm run dev --host 0.0.0.0"]
8-
volumes:
9-
- .:/app
6+
command: ["pnpm", "run", "dev", "--host", "0.0.0.0"]
107
ports:
118
- "4321:4321"
129
environment:
1310
- ASTRO_TELEMETRY_DISABLED=1
11+
- NODE_ENV=development
12+
volumes:
13+
- .:/app
14+
- node_modules:/app/node_modules
15+
- .pnpm-store:/app/.pnpm-store
16+
17+
volumes:
18+
node_modules:

0 commit comments

Comments
 (0)