Project structure update

This commit is contained in:
Darren Clarke 2023-02-09 21:51:12 +00:00
parent 86c616de0a
commit e556cdceba
70 changed files with 4127 additions and 56 deletions

View file

@ -1,41 +0,0 @@
FROM public.ecr.aws/bitnami/node:16-debian-10 as builder
LABEL maintainer="Darren Clarke <darren@redaranj.com>"
RUN useradd -u 1001 -g root node
RUN mkdir /home/node
RUN chown -R node /home/node
ARG APP_DIR=/opt/link
RUN mkdir -p ${APP_DIR}/
COPY . ${APP_DIR}/
RUN chown -R node ${APP_DIR}/
USER node
WORKDIR ${APP_DIR}
RUN npm install
RUN npm run build
FROM public.ecr.aws/bitnami/node:16-debian-10
ARG BUILD_DATE
ARG VERSION
LABEL maintainer="Darren Clarke <darren@redaranj.com>"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.version=$VERSION
ARG APP_DIR=/opt/link
ENV APP_DIR ${APP_DIR}
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --no-install-recommends \
dumb-init
RUN useradd -u 1001 -g root node
RUN mkdir -p ${APP_DIR}
RUN chown -R node ${APP_DIR}/
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
USER node
WORKDIR ${APP_DIR}
COPY --from=builder ${APP_DIR}/node_modules ./node_modules
COPY --from=builder ${APP_DIR}/.next ./.next
COPY --from=builder ${APP_DIR}/next.config.js ./next.config.js
EXPOSE 3000
ENV PORT 3000
ENV NODE_ENV production
COPY package.json ./
ENTRYPOINT ["/docker-entrypoint.sh"]