-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
55 lines (45 loc) · 1.48 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
54
55
FROM node:6
# set directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# load packages
COPY ./package.json ./
RUN npm install
COPY ./backend/ /usr/src/app/backend
COPY ./frontend/src /usr/src/app/frontend/src
COPY ./webpack.config.dev.js /usr/src/app/webpack.config.dev.js
COPY ./webpack.config.prod.js /usr/src/app/webpack.config.prod.js
COPY ./.babelrc /usr/src/app/.babelrc
COPY ./.eslintrc /usr/src/app/.eslintrc
COPY ./nodemon.json /usr/src/app/nodemon.jsodon
COPY ./secrets.env /usr/src/app/secrets.env
EXPOSE 8000
CMD ["npm", "run", "development"]
# --- Build Stage ---
# FROM base as dependancies
# install production dependancies
# RUN npm set progress=false && npm config set depth 0
# RUN npm install --only=production
# cache the production modules
# RUN cp -R node_modules prod_node_modules
# install all dependancies
# RUN npm install
# RUN npm install -g yarn
# package application
# RUN mkdir -p /usr/src/app/backend
# RUN mkdir -p /usr/src/app/frontend/src
# COPY ./backend/ /usr/src/app/backend
# COPY ./frontend/src /usr/src/app/frontend/src
# COPY ./webpack.config.dev.js /usr/src/app/webpack.config.dev.js
# COPY ./webpack.config.prod.js /usr/src/app/webpack.config.prod.js
# COPY ./.babelrc /usr/src/app/.babelrc
# COPY ./.eslintrc /usr/src/app/.eslintrc
# COPY ./nodemon.json /usr/src/app/nodemon.jsodon
# COPY ./secrets.env /usr/src/app/secrets.env
# build frontend
# RUN yarn run build
#
# --- Dev Stage ---
# FROM dependancies AS develop
# EXPOSE 3000
# CMD yarn run development