-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
54 lines (42 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
FROM node:lts-alpine
LABEL maintainer "j"
# Backend node_modules
WORKDIR /usr/src/app
# Add ffmpeg runtime dependency
RUN apk add --no-cache ffmpeg
# Add sharp library dependencies, see: http://sharp.dimens.io/en/stable/install/
RUN apk add vips-dev fftw-dev build-base --update-cache \
--repository https://alpine.global.ssl.fastly.net/alpine/edge/community/ \
--repository https://alpine.global.ssl.fastly.net/alpine/edge/main \
&& rm -rf /var/cache/apk/*
# Install dependencies
COPY package.json ./
#RUN npm install
# Build using gyp dependencies for sharp, see https://github.com/nodejs/docker-node/issues/282
RUN apk add --no-cache --virtual .gyp \
python3 \
make \
g++ \
git \
&& npm install \
&& apk del .gyp
# Frontend node_modules
WORKDIR /usr/src/app/frontend
# Install dependencies
COPY frontend/package.json ./
RUN npm install
# Bundle app source
WORKDIR /usr/src/app
COPY . ./
# Default to production mode
ENV NODE_ENV production
#ENV SWAGGER_ROOT_PATH
#ENV REACT_APP_API_PREFIX
#ENV REACT_APP_BASENAME
ENV PUBLIC_URL /
VOLUME /data
VOLUME /images
EXPOSE 3000
#CMD [ "npm", "start" ]
#TODO create entrypoint.sh
CMD npm run build-frontend && npm start