mirror of
https://github.com/morten-olsen/mini-loader.git
synced 2026-02-08 01:36:26 +01:00
init
This commit is contained in:
42
docker/Dockerfile
Normal file
42
docker/Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
FROM node:18-alpine AS base
|
||||
RUN corepack enable
|
||||
|
||||
FROM base AS builder
|
||||
RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
RUN npm install -g turbo
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN turbo prune @morten-olsen/mini-loader-server --docker
|
||||
|
||||
# Add lockfile and package.json's of isolated subworkspace
|
||||
FROM base AS installer
|
||||
RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
WORKDIR /app
|
||||
|
||||
# First install the dependencies (as they change less often)
|
||||
COPY .gitignore .gitignore
|
||||
COPY --from=builder /app/out/json/ .
|
||||
RUN pnpm install
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /app/out/full/ .
|
||||
RUN pnpm turbo run build --filter=@morten-olsen/mini-loader-server
|
||||
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
# Don't run production as root
|
||||
RUN \
|
||||
ln -s /app/packages/server/bin/index.mjs /usr/local/bin/mini-loader-server
|
||||
|
||||
COPY ./docker/entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
COPY --from=installer /app .
|
||||
EXPOSE 4500
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["mini-loader-server", "start"]
|
||||
Reference in New Issue
Block a user