Skip to content
This repository was archived by the owner on Jun 25, 2026. It is now read-only.

Commit 48fd01b

Browse files
committed
merge: resolve conflicts with main
Keep the shell recipe from main, combine compose.dev.yml (build args from main, api service and volume preservation from the branch), keep api/.gitignore.
2 parents 78fdbe1 + 88441e8 commit 48fd01b

10 files changed

Lines changed: 1669 additions & 115 deletions

File tree

Justfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ up ENV:
77
if [ "{{ENV}}" = "doc" ]; then
88
docker compose -f documentation/compose.yml up --detach
99
elif [ "{{ENV}}" = "dev" ]; then
10-
docker compose -f compose.dev.yml up --detach
10+
UID=$(id -u) GID=$(id -g) docker compose -f compose.dev.yml up --detach --build
1111
elif [ "{{ENV}}" = "prod" ]; then
1212
docker compose -f compose.prod.yml up --detach --build
1313
else
@@ -39,3 +39,6 @@ logs ENV:
3939
else
4040
echo "{{ENV}}: Accepted values are: 'doc|dev|prod'." >&2
4141
fi
42+
43+
shell ENV:
44+
docker compose -f compose.{{ENV}}.yml exec -it webapp sh

compose.dev.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
name: homepedia
2+
13
services:
24
webapp:
35
build:
46
context: webapp
57
dockerfile: docker/dev/Dockerfile
8+
args:
9+
USER_UID: "${UID:?}"
10+
USER_GID: "${GID:?}"
611
container_name: homepedia-webapp-dev
712
ports:
813
- "5173:5173"

webapp/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
This is a template for a new Vite project with React, TypeScript, and shadcn/ui.
44

5+
## Development setup
6+
7+
### Running with Docker
8+
9+
The development container is managed through `just`. To start the webapp:
10+
11+
```bash
12+
just up dev
13+
```
14+
15+
This will build the Docker image and start the container with Vite's dev server available at `http://localhost:5173`.
16+
17+
### Installing dependencies locally
18+
19+
Inside the container, `node_modules` are installed in a separate directory (`/deps/node_modules`) and symlinked into the project at startup. This avoids Docker creating a root-owned `node_modules` folder on the host through the bind mount.
20+
21+
However, your editor (e.g. VSCode) relies on a local `node_modules` directory to resolve types and provide autocompletion. You need to install dependencies on the host as well:
22+
23+
```bash
24+
cd webapp
25+
npm ci
26+
```
27+
28+
Both installs are independent: the container uses its own modules from `/deps`, while the host installation is only used by your editor.
29+
530
## Adding components
631

732
To add components to your app, run the following command:

webapp/docker/dev/Dockerfile

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,24 @@
11
FROM node:22-alpine
22

3-
WORKDIR /app
3+
ARG USER_UID=1000
4+
ARG USER_GID=1000
5+
6+
# Aligner l'UID/GID de l'utilisateur node avec l'utilisateur local
7+
RUN delgroup node 2>/dev/null; deluser node 2>/dev/null; \
8+
addgroup -g ${USER_GID} node && \
9+
adduser -u ${USER_UID} -G node -s /bin/sh -D node
10+
11+
USER node
412

5-
# Installer les dépendances en premier pour tirer parti du cache Docker
6-
COPY package*.json ./
13+
# Installer les dépendances hors du bind mount
14+
# pour éviter qu'un dossier node_modules root apparaisse sur l'hôte
15+
WORKDIR /deps
16+
COPY --chown=node:node package*.json ./
717
RUN npm ci
818

9-
# Le code source est monté via bind mount en dev
19+
WORKDIR /app
20+
1021
EXPOSE 5173
1122

12-
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
23+
# Symlink node_modules dans /app après le bind mount, puis lancer vite
24+
CMD ["sh", "-c", "ln -sf /deps/node_modules /app/node_modules && npm run dev -- --host 0.0.0.0"]

0 commit comments

Comments
 (0)