Update docker/haste/Dockerfile
ci/woodpecker/push/woodpecker Pipeline failed
Details
ci/woodpecker/push/woodpecker Pipeline failed
Details
This commit is contained in:
parent
bcb5ee574c
commit
98fb3a5588
|
@ -1,13 +1,38 @@
|
||||||
FROM node:6-alpine as builder
|
FROM node:18-alpine as builder
|
||||||
RUN apk add --no-cache git
|
|
||||||
RUN git clone --depth 1 https://git.nixc.us/Nixius/hastebin.git /app
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN npm install --production
|
|
||||||
|
# Copy package files first for better caching
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Clean npm cache and install dependencies with specific flags to avoid errors
|
||||||
|
RUN npm cache clean --force && \
|
||||||
|
npm install --production --no-optional && \
|
||||||
|
npm install mocha
|
||||||
|
|
||||||
|
# Copy the rest of the application
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Make sure app.sh is executable
|
||||||
RUN chmod +x app.sh
|
RUN chmod +x app.sh
|
||||||
|
|
||||||
FROM node:6-alpine
|
# Build assets
|
||||||
|
RUN node update-js.js
|
||||||
|
|
||||||
|
FROM node:18-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy from builder stage
|
||||||
COPY --from=builder /app .
|
COPY --from=builder /app .
|
||||||
RUN npm install --production
|
|
||||||
RUN npm install mocha
|
# Set environment variables
|
||||||
CMD ["/app/app.sh"]
|
ENV NODE_ENV=production \
|
||||||
|
HASTEBIN_ENABLE_CSP=true \
|
||||||
|
HASTEBIN_ENABLE_HSTS=true
|
||||||
|
|
||||||
|
# Expose port
|
||||||
|
EXPOSE 7777
|
||||||
|
|
||||||
|
# Use app.sh script as entry point
|
||||||
|
CMD ["/app/app.sh"]
|
Loading…
Reference in New Issue