forked from irislib/iris-messenger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 862 Bytes
/
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
# Build Stage
FROM node:19-buster-slim AS build-stage
# Install tools
RUN apt-get update \
&& apt-get install -y git \
&& apt-get install -y jq \
&& apt-get install -y python3 \
&& apt-get install -y build-essential
# Create build directory
WORKDIR /build
# Copy package.json and yarn.lock
COPY package.json yarn.lock ./
# Install dependencies
RUN yarn
# Copy project files and folders to the current working directory (i.e. '/app')
COPY . .
# Build app
RUN cat package.json | jq '.scripts.serve="sirv build --host 0.0.0.0 --port 8080 --cors --single"' > package.json.new && mv -vf package.json.new package.json
RUN yarn build
# Final image
FROM node:19-buster-slim
# Change directory to '/app'
WORKDIR /app
# Copy built code from build stage to '/app' directory
COPY --from=build-stage /build .
EXPOSE 8080
CMD [ "yarn", "preview" ]