forked from hackforla/food-oasis
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile-fullstack
45 lines (34 loc) · 1003 Bytes
/
Dockerfile-fullstack
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
FROM node:alpine as clientBuilder
ENV NODE_ENV "development"
RUN mkdir /app
WORKDIR /app
COPY client/package.json .
COPY client/package-lock.json .
RUN npm ci
COPY client .
RUN npm run build
RUN echo package.json
# Server Container
FROM node:12-buster-slim
LABEL maintainer.fola="[email protected]"
LABEL org.hackforla="Hack For LA"
LABEL description="Food Oasis app"
WORKDIR /fola
COPY package.json ./
COPY package-lock.json ./
RUN npm ci
# TODO @jafow re-structure directory heirarchy so we can flatten these down
COPY middleware/ ./middleware
COPY app/ ./app
COPY server.js ./
#COPY db/config.js ./db/
COPY --from=clientBuilder /app/build ./client/build
#COPY entrypoint.sh ./
# we dont want to run as sudo so create group and user
RUN groupadd -r fola && useradd --no-log-init -r -g fola fola
USER fola
EXPOSE 5000
ENTRYPOINT ["/usr/local/bin/node", "server.js"]
# TODO: Make this into a full-stack docker container script
#ENTRYPOINT ["./entrypoint.sh"]
#CMD ["node", "server.js"]