-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 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
#-------------------------------------
# BASE STEP
#-------------------------------------
FROM node:current-alpine as base
ENV UNOCONV_URL https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv
# installs needed packages.
RUN apk add --update --no-cache \
bash \
curl \
ffmpeg \
imagemagick \
libreoffice \
&& curl -Ls $UNOCONV_URL -o /usr/bin/unoconv \
&& chmod +x /usr/bin/unoconv \
&& sed -i 's/env python$/env python3/' /usr/bin/unoconv
#-------------------------------------
# COPY DATA STEP
#-------------------------------------
FROM base as copy-data
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
COPY yarn.lock ./
# faster NPM packages instalation using yarn.
RUN yarn install
# Bundle app source
COPY service.js ./
COPY no-image-available.png ./
#-------------------------------------
# CONFIG AND EXPOSE STEP
#-------------------------------------
FROM copy-data AS client
RUN mkdir -p /tmp/files \
&& mkdir -p /tmp/cache \
&& mkdir /storage
VOLUME /tmp/files/
VOLUME /tmp/cache/
EXPOSE 8080
CMD [ "node", "service.js" ]