-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (28 loc) · 900 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
40
41
FROM alpine:latest AS builder
WORKDIR /var/www/api
RUN apk add --update-cache \
--repository http://dl-3.alpinelinux.org/alpine/latest-stable/main \
--repository http://dl-3.alpinelinux.org/alpine/latest-stable/community \
vips-dev fftw-dev gcc g++ make libc6-compat
RUN apk add --update nodejs npm git
COPY . .
RUN npm install --unsafe-perm
RUN npm run build
FROM bethrezen/mozjpeg-docker AS mozjpeg
FROM alpine:latest
RUN apk add --update-cache --repository http://dl-3.alpinelinux.org/alpine/latest-stable/community \
vips \
nodejs \
npm \
git
WORKDIR /var/www/api
COPY .env ./
COPY .env.example ./
COPY ./package* ./
COPY ./index.js ./
## copy mozjpeg bins
COPY --from=mozjpeg /usr/local /usr/local
COPY --from=builder /var/www/api/node_modules ./node_modules
COPY --from=builder /var/www/api/lib ./lib
RUN npm install --ignore-scripts=false sharp
CMD ["npm", "start"]