This repository was archived by the owner on Apr 23, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (39 loc) · 1.13 KB
/
Dockerfile
File metadata and controls
46 lines (39 loc) · 1.13 KB
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
# Deps
FROM node:19-alpine as base
WORKDIR /app
RUN apk update --no-cache
RUN apk add --no-cache python3 make gcc g++ bash curl
COPY package.json yarn.lock tsconfig.json tsup.config.ts prisma ./
# Build
FROM base as build
WORKDIR /app
RUN yarn install --frozen-lockfile
COPY src ./src
RUN yarn generate
RUN yarn build
# Runner
FROM base as runner
WORKDIR /app
ENV NODE_ENV="production"
ENV DATABASE_URL "file:/app/config/db.sqlite"
ARG VERSION
ENV VERSION=$VERSION
COPY --from=build /app/node_modules/.prisma /app/node_modules/.prisma
COPY --from=build /app/dist dist
RUN yarn install --production --frozen-lockfile
CMD npx prisma migrate deploy && yarn start
# Runner
FROM build as pterodactyl
ENV NODE_ENV="production"
ENV DATABASE_URL "file:/home/container/dynamica/db.sqlite"
ARG VERSION
ENV VERSION=$VERSION
WORKDIR /app
RUN yarn install --production --frozen-lockfile
COPY --from=build /app/node_modules/.prisma /app/node_modules/.prisma
COPY --from=build /app/dist dist
RUN adduser -H -D container -s /bin/bash
ENV USER=container HOME=/home/container
USER container
COPY entrypoint.sh /entrypoint.sh
CMD [ "/bin/bash", "/entrypoint.sh" ]