-
Notifications
You must be signed in to change notification settings - Fork 70
/
Dockerfile
39 lines (28 loc) · 904 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
39
## This container generates language files
FROM alpine:3.7 AS langbuilder
RUN apk add --no-cache gettext
COPY lang/ lang/
ARG BOT_NAME=QTweet
ARG PREFIX=!!
RUN for file in ./lang/*.ftl; do f=${file%.ftl}; cat $file | envsubst '$BOT_NAME:$PREFIX' > $f.o.ftl; echo "Built $f.o.ftl "; done
## This container compiles src/ files from typescript to javascript
FROM node:17-alpine AS compiler
WORKDIR /app
# Copy build files and install using yarn
COPY package.json .
COPY yarn.lock .
RUN yarn install
# Copy everything over
COPY . .
RUN yarn build
## This is the actual qtweet container, using the results from the 2 previous containers
FROM node:17-alpine
WORKDIR /app
COPY package.json .
COPY yarn.lock .
RUN yarn install --production
# Copy generated language files
COPY --from=langbuilder /lang/*.o.ftl lang/
# Copy dist files over
COPY --from=compiler /app/dist ./dist
CMD [ "yarn", "start" ]