@@ -62,6 +62,10 @@ COPY ./backend/launch_redis_workers.py /repo/backend/
6262
6363RUN uv sync
6464
65+ # Extract version from pyproject.toml
66+ RUN mkdir -p /version
67+ RUN python -c "import tomllib; print(tomllib.load(open('/repo/backend/pyproject.toml', 'rb'))['project']['version'])" > /version/backend.txt
68+
6569# ------------------------------------------------------------------------------------ #
6670# Development #
6771# ------------------------------------------------------------------------------------ #
@@ -75,6 +79,19 @@ RUN --mount=type=cache,target=/var/cache/apk \
7579RUN npm install -g pnpm
7680RUN pnpm config set store-dir /repo/frontend/.pnpm-store
7781
82+ # Copy the lock files and install dependencies
83+ WORKDIR /repo
84+ COPY ./frontend/package.json /repo/frontend/
85+ COPY ./frontend/pnpm-lock.yaml /repo/frontend/
86+
87+ WORKDIR /repo/frontend
88+ RUN pnpm i
89+
90+ # Extract version from package.json
91+ RUN mkdir -p /version
92+ RUN python -c "import json; print(json.load(open('/repo/frontend/package.json'))['version'])" \
93+ > /version/frontend.txt
94+
7895ENV IB_SERVER_CONFIG="dev_docker"
7996
8097# relies on mounting this volume
@@ -113,12 +130,20 @@ WORKDIR /repo
113130COPY ./frontend ./frontend/
114131RUN chown -R beetle:beetle /repo
115132
133+ # Extract version from package.json
134+ RUN mkdir -p /version
135+ RUN python -c "import json; print(json.load(open('/repo/frontend/package.json'))['version'])" \
136+ > /version/frontend.txt
137+
116138USER beetle
117139WORKDIR /repo/frontend
118140# RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store \
119141RUN pnpm install
120142RUN pnpm run build
121143
144+
145+
146+
122147# ------------------------------------------------------------------------------------ #
123148# Production #
124149# ------------------------------------------------------------------------------------ #
@@ -129,9 +154,11 @@ ENV IB_SERVER_CONFIG="prod"
129154
130155WORKDIR /repo
131156COPY --from=build /repo/frontend/dist /repo/frontend/dist
157+ COPY --from=build /version /version
132158COPY docker/entrypoints/entrypoint.sh .
133159COPY docker/entrypoints/entrypoint_user_scripts.sh .
134160COPY docker/entrypoints/entrypoint_fix_permissions.sh .
161+ COPY docker/entrypoints/common.sh .
135162RUN chown -R beetle:beetle /repo
136163
137164USER root
0 commit comments