Skip to content

Commit 5f53686

Browse files
chore: add yarnrc to dockerfile
1 parent c52d89f commit 5f53686

File tree

3 files changed

+22
-7
lines changed

3 files changed

+22
-7
lines changed

.devcontainer/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
FROM mcr.microsoft.com/devcontainers/javascript-node:20
22

3-
RUN corepack enable
3+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4+
5+
RUN curl -fsSL https://get.docker.com | sh && rm -rf /var/lib/apt/lists/*
6+
RUN usermod -aG docker node && newgrp docker
7+
8+
RUN corepack enable

.devcontainer/devcontainer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@
88
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
99
}
1010
},
11+
"mounts": [
12+
{
13+
"source": "/var/run/docker.sock",
14+
"target": "/var/run/docker.sock",
15+
"type": "bind"
16+
}
17+
],
1118
"onCreateCommand": "yarn install",
19+
"postCreateCommand": "sudo chown root:docker /var/run/docker.sock",
1220
"remoteUser": "node"
1321
}

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,25 @@ FROM node:20-slim as builder
22

33
WORKDIR /usr/src/app
44

5-
ADD package.json .
6-
ADD yarn.lock .
5+
COPY ./package.json ./
6+
COPY ./yarn.lock ./
7+
COPY ./.yarnrc.yml ./
78

89
RUN corepack enable
910
RUN yarn install --immutable
1011

11-
ADD tsconfig.json .
12-
ADD src/ ./src/
12+
COPY tsconfig.json .
13+
COPY src/ ./src/
1314

1415
RUN yarn build
1516

1617
FROM node:20-slim
1718

1819
WORKDIR /usr/src/app
1920

20-
ADD package.json .
21-
ADD yarn.lock .
21+
COPY ./package.json ./
22+
COPY ./yarn.lock ./
23+
COPY ./.yarnrc.yml ./
2224

2325
RUN corepack enable
2426
RUN yarn install --immutable

0 commit comments

Comments
 (0)