generated from Start9Labs/hello-world-startos
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
46 lines (34 loc) · 1.07 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# syntax=docker/dockerfile:1
FROM node:20 AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app
# Copy package files and install dependencies
COPY ./nostrudel/package*.json .
COPY ./nostrudel/pnpm-lock.yaml .
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
# set version env
ARG COMMIT_HASH=""
ARG APP_VERSION="Start9-OS"
ENV VITE_COMMIT_HASH="$COMMIT_HASH"
ENV VITE_APP_VERSION="$APP_VERSION"
# Copy application files
COPY ./nostrudel/tsconfig.json .
COPY ./nostrudel/vite.config.ts .
COPY ./nostrudel/index.html .
COPY ./nostrudel/public ./public
COPY ./nostrudel/src ./src
# build
RUN pnpm build
FROM nginx:stable-alpine-slim
RUN apk update && \
apk add --no-cache yq && \
rm -rf /var/cache/apk/*
EXPOSE 8080
COPY --from=build /app/dist /usr/share/nginx/html
ADD ./docker_entrypoint.sh /usr/local/bin/docker_entrypoint.sh
RUN chmod a+x /usr/local/bin/docker_entrypoint.sh