-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (40 loc) · 1.2 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
# Builder
#
FROM node:16 AS builder
WORKDIR /app
COPY ./server/package.json ./server/yarn.lock ./server/tsconfig.json ./
RUN yarn install --frozen-lockfile
COPY ./server .
RUN yarn build
#
# Client Builder
#
FROM ubuntu:20.04 AS client-builder
ARG DEBIAN_FRONTEND=noninteractive
ARG API_AUTHORITY
RUN apt-get update && apt-get install -y curl git wget unzip fonts-droid-fallback python3
RUN apt-get clean
RUN apt-get update && apt-get install -y build-essential
RUN apt-get clean
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}"
WORKDIR /usr/local/flutter
RUN flutter channel master
RUN flutter upgrade
RUN flutter config --enable-web
WORKDIR /app
COPY ./client .
RUN flutter pub get
RUN flutter build web --release --dart-define API_AUTHORITY=${API_AUTHORITY}
#
# Runner
#
FROM node:16
WORKDIR /app
COPY ./server/package.json ./server/yarn.lock ./server/tsconfig.json ./
COPY --from=builder /app/build /app/build
COPY --from=builder /app/assets /app/assets
COPY --from=client-builder /app/build/web /app/public
RUN yarn install --production --frozen-lockfile
CMD [ "node", "build/index.js" ]