generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Dockerfile-jared
40 lines (30 loc) · 968 Bytes
/
Dockerfile-jared
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
# Server Build Container
FROM node:lts-alpine as serverBuilder
WORKDIR /usr/src
COPY tsconfig.json ./
WORKDIR /usr/src/app
RUN mkdir build
COPY ./server/tsconfig.json ./
COPY ./server/package.json ./
COPY ./server/package-lock.json ./
COPY ./server/middleware/ ./middleware
COPY ./server/types/ ./types
COPY ./server/app/ ./app
COPY ./server/server.ts ./
RUN npm ci --quiet && npm run build
# Server Container
FROM node:buster-slim
LABEL maintainer.fola="[email protected]"
LABEL org.hackforla="Hack For LA"
LABEL description="Food Oasis app"
WORKDIR /fola
COPY ./server/package.json ./
COPY ./server/package-lock.json ./
RUN npm ci --quiet
COPY --from=serverBuilder /usr/src/app/build ./
COPY ./server/uploads ./uploads
# we don't 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 5001
ENTRYPOINT ["/usr/local/bin/node", "./server.js"]