forked from riodw/BloomBus-Server
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
38 lines (29 loc) · 907 Bytes
/
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
# This Dockerfile is not optimized, all node_modules and sourcefiles included
FROM node:lts
# Create ARG for credentials to bring in file path from build command. See README.
ARG app_creds
# Copy the credentials file into the image
COPY ${app_creds} /etc/serviceAccountKey.json
# Pass ARG to container
ENV GOOGLE_APPLICATION_CREDENTIALS=/etc/serviceAccountKey.json
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
# RUN npm install
# If you are building your code for production
RUN npm install
# Bundle app source
COPY . .
# Convert typescript file to vanilla JS
# RUN npm run build
# Build webapp
WORKDIR /usr/src/app/webapp/
RUN npm install
RUN npm run build
# Return to root and start
WORKDIR /usr/src/app
EXPOSE 8080
CMD [ "npm", "start" ]