2017-10-17 17:05:21 +02:00
|
|
|
FROM node:alpine
|
2017-11-13 14:39:57 +01:00
|
|
|
|
2017-05-27 15:24:50 +02:00
|
|
|
# Create app directory
|
|
|
|
RUN mkdir -p /usr/src/app
|
|
|
|
WORKDIR /usr/src/app
|
2017-11-13 14:39:57 +01:00
|
|
|
|
2017-05-27 15:24:50 +02:00
|
|
|
# Install app dependencies
|
|
|
|
COPY package.json /usr/src/app/
|
2017-11-13 14:39:57 +01:00
|
|
|
|
2020-07-25 10:29:55 +02:00
|
|
|
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
|
|
|
|
|
|
|
|
ARG CHANGE_SOURCE=false
|
|
|
|
RUN if [ ${CHANGE_SOURCE} = true ]; then \
|
|
|
|
# Change application source from dl-cdn.alpinelinux.org to aliyun source
|
|
|
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories \
|
|
|
|
;fi
|
|
|
|
|
2017-11-13 14:39:57 +01:00
|
|
|
RUN apk add --update \
|
2021-09-10 09:04:53 +02:00
|
|
|
python3 \
|
|
|
|
python3-dev \
|
2017-11-13 14:39:57 +01:00
|
|
|
py-pip \
|
|
|
|
build-base
|
|
|
|
|
2017-05-27 15:24:50 +02:00
|
|
|
RUN npm install
|
2017-11-13 14:39:57 +01:00
|
|
|
|
2017-05-27 15:24:50 +02:00
|
|
|
# Bundle app source
|
|
|
|
COPY laravel-echo-server.json /usr/src/app/laravel-echo-server.json
|
2017-11-13 14:39:57 +01:00
|
|
|
|
2017-05-27 15:24:50 +02:00
|
|
|
EXPOSE 3000
|
2019-03-20 14:51:29 +01:00
|
|
|
CMD [ "npm", "start", "--force" ]
|