forked from msgbyte/tailchat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (36 loc) · 1.09 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
47
FROM node:18.18.0-alpine
# use with --build-arg VERSION=xxxx
ARG VERSION
# Working directory
WORKDIR /app/tailchat
RUN ulimit -n 10240
# Install dependencies
RUN npm install -g [email protected]
RUN npm install -g tailchat-cli@latest
# Add mc for minio
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O /usr/local/bin/mc
RUN chmod +x /usr/local/bin/mc
# Install plugins and sdk dependency
COPY ./tsconfig.json ./tsconfig.json
COPY ./packages ./packages
COPY ./server/packages ./server/packages
COPY ./server/plugins ./server/plugins
COPY ./server/package.json ./server/package.json
COPY ./server/tsconfig.json ./server/tsconfig.json
COPY ./package.json ./pnpm-lock.yaml ./pnpm-workspace.yaml ./.npmrc ./
COPY ./patches ./patches
RUN pnpm install --frozen-lockfile
# Copy client
COPY ./client ./client
RUN pnpm install --frozen-lockfile
# Copy all source
COPY . .
RUN pnpm install --frozen-lockfile
# Build and cleanup (client and server)
ENV NODE_ENV=production
ENV VERSION=$VERSION
RUN pnpm build
# web static service port
EXPOSE 3000
# Start server, ENV var is necessary
CMD ["pnpm", "start:service"]