-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (25 loc) · 882 Bytes
/
Copy pathDockerfile
File metadata and controls
37 lines (25 loc) · 882 Bytes
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
# This Dockerfile is for Heroku deployments only!
# A node.js v10 box
FROM node:10
# Who(m) to blame if nothing works
#MAINTAINER nobody@nowhere.com
# Create a working directory
RUN mkdir -p /var/www
# Switch to working directory
WORKDIR /var/www
# Set the environment for Heroku
ENV NODE_ENV=production
# Copy contents of api folder to `WORKDIR` (root of build is now Express App)
COPY ./api .
COPY ./src ./src
COPY ./public ./public
# Copy the React build artifacts to a separate folder for static middleware
# COPY ./build ./build
# Install dependencies ... package.json from ./api is now in the root of container (so it's referenced here!)
RUN yarn install
#RUN npm install -g react react-scripts
# Build the React App
RUN node_modules/.bin/react-scripts build
# NOTE: Heroku does not support specifying ports
# Start the Node.js app on load
CMD [ "npm", "start" ]