forked from actionsx/prettier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpine.Dockerfile
31 lines (24 loc) 路 823 Bytes
/
alpine.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM oven/bun:alpine AS deps
# Install dependencies here, so Docker can cache them.
WORKDIR /temp/dev
COPY package.json bun.lockb /temp/dev/
RUN bun install --frozen-lockfile --production
# Copy files for Build
FROM deps AS build
ENV NODE_ENV=production
WORKDIR /app
COPY --from=deps /temp/dev/node_modules node_modules
COPY . .
RUN bun run build-bun && \
chmod +x /app/dist/bun-prettier.js && \
mv /app/dist/bun-prettier.js /prettier.js
# Start the Container
FROM oven/bun:alpine as run
USER guest
WORKDIR /lint
COPY --from=build /prettier.js /usr/prettier.js
ENTRYPOINT [ "bun", "run", "/usr/prettier.js" ]
CMD [ "--check ." ]
LABEL org.opencontainers.image.title="Prettier CLI"
LABEL org.opencontainers.image.source="https://github.com/hudsonm62/prettier-cli"
LABEL org.opencontainers.image.license="MIT"