Files
azure-storage-emulator/Dockerfile

35 lines
890 B
Docker

# syntax=docker/dockerfile
# Build
FROM node:20-alpine AS build
WORKDIR /app
ARG AZURITE_VER=v3.35.0
RUN apk add --no-cache git
RUN git clone --branch "${AZURITE_VER}" --depth 1 https://github.com/Azure/Azurite.git azurite
WORKDIR /app/azurite
RUN npm ci
RUN npm run build
# Pull Caddy
FROM caddy:2-alpine AS caddy
# Build final image on top of Node alpine
FROM node:20-alpine
WORKDIR /app
RUN apk add --no-cache openssl bash
COPY --from=caddy /usr/bin/caddy /usr/bin/caddy
COPY --from=caddy /etc/caddy /etc/caddy
COPY --from=build /app/azurite/package*.json ./azurite/
COPY --from=build /app/azurite/dist/src ./azurite/src
WORKDIR /app/azurite
RUN npm pkg set scripts.prepare="echo no-prepare"
RUN npm ci --omit=dev --unsafe-perm
WORKDIR /app
COPY ./cert-functions.sh ./
COPY ./entrypoint.sh .
COPY ./Caddyfile.example .
RUN chmod +x entrypoint.sh
ENTRYPOINT [ "/app/entrypoint.sh" ]