Update docker/haste/Dockerfile
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
3f2167eb1e
commit
356028cb4a
|
@ -1,23 +1,20 @@
|
||||||
FROM node:18-alpine as builder
|
FROM node:18-alpine as builder
|
||||||
|
|
||||||
|
# Install git and other dependencies
|
||||||
|
RUN apk add --no-cache git
|
||||||
|
|
||||||
|
# Clone the repository
|
||||||
|
RUN git clone --depth 1 https://git.nixc.us/Nixius/hastebin.git /app
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy package files first - this is the key fix
|
# Clean npm cache and install dependencies with better error handling
|
||||||
COPY package.json package-lock.json ./
|
|
||||||
|
|
||||||
# Clean npm cache and install dependencies with specific flags to avoid errors
|
|
||||||
RUN npm cache clean --force && \
|
RUN npm cache clean --force && \
|
||||||
npm install --production --no-optional && \
|
npm install --production --no-optional && \
|
||||||
npm install mocha
|
chmod +x app.sh
|
||||||
|
|
||||||
# Copy the rest of the application AFTER installing dependencies
|
# Build assets if needed
|
||||||
COPY . .
|
RUN node update-js.js || echo "No update-js.js script found"
|
||||||
|
|
||||||
# Make sure app.sh is executable
|
|
||||||
RUN chmod +x app.sh
|
|
||||||
|
|
||||||
# Build assets
|
|
||||||
RUN node update-js.js
|
|
||||||
|
|
||||||
FROM node:18-alpine
|
FROM node:18-alpine
|
||||||
|
|
||||||
|
@ -26,10 +23,14 @@ WORKDIR /app
|
||||||
# Copy from builder stage
|
# Copy from builder stage
|
||||||
COPY --from=builder /app .
|
COPY --from=builder /app .
|
||||||
|
|
||||||
|
# Install mocha in the final image
|
||||||
|
RUN npm install mocha
|
||||||
|
|
||||||
# Set environment variables
|
# Set environment variables
|
||||||
ENV NODE_ENV=production \
|
ENV NODE_ENV=production \
|
||||||
HASTEBIN_ENABLE_CSP=true \
|
HASTEBIN_ENABLE_CSP=true \
|
||||||
HASTEBIN_ENABLE_HSTS=true
|
HASTEBIN_ENABLE_HSTS=true \
|
||||||
|
HASTEBIN_ENABLE_CROSS_ORIGIN_ISOLATION=true
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 7777
|
EXPOSE 7777
|
||||||
|
|
Loading…
Reference in New Issue