22 lines
552 B
Docker
22 lines
552 B
Docker
FROM alpine:latest AS version
|
|
COPY VERSION.txt /tmp/version.txt
|
|
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app/www
|
|
COPY www/package.json www/package-lock.json ./
|
|
RUN npm install
|
|
|
|
COPY www/ ./
|
|
RUN node build-blog.js
|
|
|
|
FROM nginx:alpine
|
|
COPY --from=version /tmp/version.txt /tmp/version.txt
|
|
ENV VERSION=$(cat /tmp/version.txt)
|
|
|
|
COPY --from=builder /app/www/ /usr/share/nginx/html/
|
|
COPY docker-entrypoint.d/ /docker-entrypoint.d/
|
|
RUN chmod +x /docker-entrypoint.d/*.sh
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.d/30-envsubst.sh", "--", "nginx", "-g", "daemon off;"]
|