nfp_sites/Dockerfile

51 lines
1.4 KiB
Text
Raw Normal View History

2019-09-14 19:03:38 +00:00
###########################
# Angular
###########################
2021-01-04 10:55:22 +00:00
FROM node:12-alpine as build
2019-09-14 19:03:38 +00:00
ENV HOME=/app
COPY package.json $HOME/
COPY app $HOME/app
COPY public $HOME/public
WORKDIR $HOME
2021-01-04 10:55:22 +00:00
RUN apk add --update --no-cache --virtual .build-deps gcc g++ make libc6-compat python git && \
apk add vips-dev fftw-dev build-base --no-cache \
--repository http://dl-3.alpinelinux.org/alpine/v3.10/community \
--repository http://dl-3.alpinelinux.org/alpine/v3.10/main && \
2019-09-14 19:03:38 +00:00
npm install && \
apk del .build-deps gcc g++ make libc6-compat python && \
apk del build-base && \
npm run build
###########################
# Server
###########################
2021-01-04 11:00:22 +00:00
FROM node:12-alpine
2019-09-14 19:03:38 +00:00
ENV HOME=/app
COPY index.mjs package.json server.mjs $HOME/
WORKDIR $HOME
2021-01-04 10:55:22 +00:00
RUN apk add --update --no-cache --virtual .build-deps gcc g++ make libc6-compat python git && \
apk add vips-dev fftw-dev build-base --no-cache \
--repository http://dl-3.alpinelinux.org/alpine/v3.10/community \
--repository http://dl-3.alpinelinux.org/alpine/v3.10/main && \
2019-09-14 19:03:38 +00:00
npm install --production && \
rm -Rf $HOME/.npm $HOME/.npm $HOME/.config && \
apk del .build-deps gcc g++ make libc6-compat python && \
apk del build-base
COPY api $HOME/api
COPY migrations $HOME/migrations
COPY config $HOME/config
COPY --from=build /app/public $HOME/public
EXPOSE 4030
CMD ["npm", "start"]