mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
30 lines
762 B
Go
30 lines
762 B
Go
# syntax=docker/dockerfile:1
|
|
|
|
FROM node:alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json /app/
|
|
|
|
RUN --mount=type=cache,target=/root/.npm,id=npm_cache \
|
|
npm install --registry=https://registry.npmmirror.com
|
|
|
|
COPY src /app/src
|
|
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine
|
|
|
|
COPY --from=builder /app/dist /app/dist
|
|
|
|
RUN --mount=type=bind,from=php:alpine,source=/usr/local/bin/docker-php-entrypoint,target=/docker-php-entrypoint \
|
|
cat /docker-php-entrypoint
|
|
|
|
RUN --mount=type=tmpfs,target=/temp \
|
|
mount | grep /temp
|
|
|
|
RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \
|
|
test -s /root/.aws/credentials && echo "credentials mounted"
|
|
|
|
# docker build -t test --secret id=aws,src=$PWD/aws.txt --progress=plain -f Dockerfile.buildkit .
|