fix(cicd): fix yarn version, surface the real failure, bust cache
This commit is contained in:
+3
-8
@@ -1,27 +1,22 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM node:20-alpine AS builder
|
FROM node:20-alpine AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Enable Corepack so we can use Yarn v4
|
# Enable Corepack so we can use Yarn v4 (pinned to match lockfile)
|
||||||
RUN corepack enable && corepack prepare yarn@stable --activate
|
RUN corepack enable && corepack prepare yarn@4.11.0 --activate
|
||||||
# Force Yarn to use node_modules instead of PnP
|
# Force Yarn to use node_modules instead of PnP
|
||||||
ENV YARN_NODE_LINKER=node-modules
|
ENV YARN_NODE_LINKER=node-modules
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn install --immutable
|
RUN yarn install --immutable
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN yarn build
|
RUN yarn build && ls -la dist
|
||||||
|
|
||||||
# Production stage - Caddy
|
# Production stage - Caddy
|
||||||
FROM caddy:2-alpine
|
FROM caddy:2-alpine
|
||||||
|
|
||||||
WORKDIR /usr/share/caddy
|
WORKDIR /usr/share/caddy
|
||||||
|
|
||||||
# Copy built static files from the builder stage
|
# Copy built static files from the builder stage
|
||||||
COPY --from=builder /app/dist .
|
COPY --from=builder /app/dist .
|
||||||
|
|
||||||
# Copy our local Caddyfile config
|
# Copy our local Caddyfile config
|
||||||
COPY Caddyfile /etc/caddy/Caddyfile
|
COPY Caddyfile /etc/caddy/Caddyfile
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Start caddy using the config file
|
# Start caddy using the config file
|
||||||
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
|
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
|
||||||
Reference in New Issue
Block a user