thibaud frere
commited on
Commit
·
d912fc5
1
Parent(s):
110f15a
Fix Docker build for LFS files - install git-lfs and pull LFS files during build
Browse files- Dockerfile +13 -7
Dockerfile
CHANGED
|
@@ -2,18 +2,24 @@
|
|
| 2 |
# Build with Playwright (browsers and deps ready)
|
| 3 |
FROM mcr.microsoft.com/playwright:v1.55.0-jammy AS build
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
# Set the working directory in the container
|
| 6 |
-
WORKDIR /
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Install dependencies
|
| 12 |
RUN npm install
|
| 13 |
|
| 14 |
-
# Copy the rest of the application code
|
| 15 |
-
COPY app/ .
|
| 16 |
-
|
| 17 |
# Ensure `public/data` is a real directory with real files (not a symlink)
|
| 18 |
# This handles the case where `public/data` is a symlink in the repo, which
|
| 19 |
# would be broken inside the container after COPY.
|
|
@@ -34,7 +40,7 @@ RUN npm run export:pdf -- --theme=light --wait=full
|
|
| 34 |
FROM nginx:alpine
|
| 35 |
|
| 36 |
# Copy the built application from the build stage
|
| 37 |
-
COPY --from=build /app/dist /usr/share/nginx/html
|
| 38 |
|
| 39 |
# Copy a custom Nginx configuration file
|
| 40 |
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
| 2 |
# Build with Playwright (browsers and deps ready)
|
| 3 |
FROM mcr.microsoft.com/playwright:v1.55.0-jammy AS build
|
| 4 |
|
| 5 |
+
# Install git and git-lfs for handling LFS files
|
| 6 |
+
RUN apt-get update && apt-get install -y git git-lfs && apt-get clean
|
| 7 |
+
|
| 8 |
# Set the working directory in the container
|
| 9 |
+
WORKDIR /workspace
|
| 10 |
+
|
| 11 |
+
# Copy the entire git repository (including .git folder and LFS files)
|
| 12 |
+
COPY . .
|
| 13 |
|
| 14 |
+
# Pull LFS files
|
| 15 |
+
RUN git lfs pull
|
| 16 |
+
|
| 17 |
+
# Move to app directory for building
|
| 18 |
+
WORKDIR /workspace/app
|
| 19 |
|
| 20 |
# Install dependencies
|
| 21 |
RUN npm install
|
| 22 |
|
|
|
|
|
|
|
|
|
|
| 23 |
# Ensure `public/data` is a real directory with real files (not a symlink)
|
| 24 |
# This handles the case where `public/data` is a symlink in the repo, which
|
| 25 |
# would be broken inside the container after COPY.
|
|
|
|
| 40 |
FROM nginx:alpine
|
| 41 |
|
| 42 |
# Copy the built application from the build stage
|
| 43 |
+
COPY --from=build /workspace/app/dist /usr/share/nginx/html
|
| 44 |
|
| 45 |
# Copy a custom Nginx configuration file
|
| 46 |
COPY nginx.conf /etc/nginx/nginx.conf
|