Skip to content

Commit 23f5993

Browse files
authored
Add files via upload
Signed-off-by: Raileen Del Rosario <43893067+raileendr@users.noreply.github.com>
0 parents  commit 23f5993

95 files changed

Lines changed: 6637 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Containerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Global arguments
2+
ARG BASE_IMAGE=node:lts-alpine
3+
ARG APP_DIR=/usr/src/app
4+
ARG UID=1000
5+
ARG GID=1000
6+
ARG PORT=3000
7+
8+
# Base stage
9+
FROM ${BASE_IMAGE} AS base
10+
ARG APP_DIR
11+
ARG UID
12+
ARG GID
13+
ARG PORT
14+
15+
RUN mkdir -p ${APP_DIR} && \
16+
chown -R ${UID}:${GID} ${APP_DIR}
17+
18+
USER ${UID}:${GID}
19+
20+
WORKDIR ${APP_DIR}
21+
22+
ENV PORT=${PORT}
23+
EXPOSE ${PORT}
24+
25+
COPY --chown=${UID}:${GID} package.json .
26+
27+
# Dependencies stage
28+
FROM base AS dependencies
29+
ARG APP_DIR
30+
31+
RUN npm install && \
32+
npm cache clean --force && \
33+
touch ${APP_DIR}/production.env && \
34+
touch ${APP_DIR}/development.env
35+
36+
ENV PATH=${APP_DIR}/node_modules/.bin:$PATH
37+
38+
# Development stage
39+
FROM dependencies AS development
40+
ARG UID
41+
ARG GID
42+
43+
ENV NODE_ENV=development
44+
45+
COPY --chown=${UID}:${GID} . .
46+
47+
CMD ["npm", "run", "dev"]
48+
49+
# Build stage
50+
FROM dependencies AS build
51+
ARG UID
52+
ARG GID
53+
54+
COPY --chown=${UID}:${GID} . .
55+
56+
RUN npm run build
57+
58+
# Production stage
59+
FROM dependencies AS production
60+
ARG UID
61+
ARG GID
62+
ARG APP_DIR
63+
64+
ENV NODE_ENV=production
65+
66+
COPY --chown=${UID}:${GID} ./views ./views
67+
COPY --chown=${UID}:${GID} --from=build ${APP_DIR}/dist ./dist
68+
69+
CMD ["node", "./dist", "--env=production"]

Dockerfile

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Global arguments
2+
ARG BASE_IMAGE=node:lts-alpine
3+
ARG APP_DIR=/usr/src/app
4+
ARG UID=1000
5+
ARG GID=1000
6+
ARG PORT=3000
7+
8+
# Base stage
9+
FROM ${BASE_IMAGE} AS base
10+
ARG APP_DIR
11+
ARG UID
12+
ARG GID
13+
ARG PORT
14+
15+
RUN mkdir -p ${APP_DIR} && \
16+
chown -R ${UID}:${GID} ${APP_DIR}
17+
18+
USER ${UID}:${GID}
19+
20+
WORKDIR ${APP_DIR}
21+
22+
ENV PORT=${PORT}
23+
EXPOSE ${PORT}
24+
25+
# Dependencies stage
26+
FROM base AS dependencies
27+
ARG APP_DIR
28+
29+
RUN --mount=type=bind,source=./package.json,target=${APP_DIR}/package.json \
30+
--mount=type=cache,target=${APP_DIR}/.npm,uid=$UID,gid=$GID,mode=0755,sharing=locked \
31+
npm install && \
32+
touch ${APP_DIR}/production.env && \
33+
touch ${APP_DIR}/development.env
34+
35+
ENV PATH=${APP_DIR}/node_modules/.bin:$PATH
36+
37+
# Development stage
38+
FROM dependencies AS development
39+
ARG UID
40+
ARG GID
41+
42+
ENV NODE_ENV=development
43+
44+
COPY --chown=${UID}:${GID} . .
45+
46+
CMD ["npm", "run", "dev"]
47+
48+
# Build stage
49+
FROM dependencies AS build
50+
ARG UID
51+
ARG GID
52+
53+
COPY --chown=${UID}:${GID} . .
54+
55+
RUN npm run build
56+
57+
# Production stage
58+
FROM dependencies AS production
59+
ARG UID
60+
ARG GID
61+
ARG APP_DIR
62+
63+
ENV NODE_ENV=production
64+
65+
COPY --chown=${UID}:${GID} package.json .
66+
COPY --chown=${UID}:${GID} ./views ./views
67+
COPY --chown=${UID}:${GID} --from=build ${APP_DIR}/dist ./dist
68+
69+
CMD ["node", "./dist", "--env=production"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Docusign Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)