Skip to content

Commit f372215

Browse files
MohsinHashmi-DataInnmohsin-wiserclaude
authored
chore(devcontainer): optimize prebuilt image performance (v2) (#329)
* fix(devcontainer): add workspace mount to docker-compose - add explicit workspace mount ../:/workspaces/SimpleAccounts-UAE - use fixed workspace path instead of variable - fixes 'lstat /workspaces/content: no such file or directory' error 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * chore(devcontainer): optimize prebuilt image performance - Bake Playwright system dependencies into Dockerfile - Combine apt-get layers for efficiency - Pre-cache Maven and NPM dependencies during build - Update post-create.sh to utilize pre-seeded caches * fix(devcontainer): remove duplicate instructions and include .npmrc --------- Co-authored-by: Mohsin Hashmi <mhashmi@wiser.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e4b7017 commit f372215

1 file changed

Lines changed: 6 additions & 19 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,9 @@ FROM mcr.microsoft.com/devcontainers/java:21-bookworm
77
ARG NODE_VERSION="20"
88
RUN su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
99

10-
# ============================================
10+
# ============================================
1111
# INSTALL TOOLS (baked in for faster startup)
12-
# ============================================
13-
14-
# SimpleAccounts-UAE Development Container
15-
# Base image with Node 20 and Java 21 for full-stack development
16-
17-
FROM mcr.microsoft.com/devcontainers/java:21-bookworm
18-
19-
# Install Node.js 20
20-
ARG NODE_VERSION="20"
21-
RUN su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
22-
23-
# ============================================
24-
# INSTALL TOOLS (baked in for faster startup)
25-
# ============================================
12+
# ============================================
2613

2714
# Install Docker CLI, Docker Compose, GitHub CLI, and System Dependencies
2815
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
@@ -95,9 +82,9 @@ ENV PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH=/usr/bin/chromium
9582
# Install global npm packages
9683
RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g npm@latest" 2>&1
9784

98-
# ============================================
85+
# ============================================
9986
# PRE-CACHE DEPENDENCIES
100-
# ============================================
87+
# ============================================
10188

10289
USER vscode
10390

@@ -114,7 +101,7 @@ COPY --chown=vscode:vscode package.json package-lock.json ./
114101
RUN . /usr/local/share/nvm/nvm.sh && npm ci --ignore-scripts
115102

116103
WORKDIR /tmp/frontend
117-
COPY --chown=vscode:vscode apps/frontend/package.json apps/frontend/package-lock.json ./
104+
COPY --chown=vscode:vscode apps/frontend/package.json apps/frontend/package-lock.json apps/frontend/.npmrc* ./
118105
RUN . /usr/local/share/nvm/nvm.sh && npm ci --legacy-peer-deps --ignore-scripts
119106

120107
# Clean up temp directories
@@ -125,4 +112,4 @@ RUN rm -rf /tmp/backend /tmp/root /tmp/frontend
125112
WORKDIR /workspaces
126113

127114
# Default command
128-
CMD ["sleep", "infinity"]
115+
CMD ["sleep", "infinity"]

0 commit comments

Comments
 (0)