mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
did some improvements on the maintenance docker image
This commit is contained in:
parent
5dc844b431
commit
cb464832d6
@ -1,19 +1,56 @@
|
|||||||
|
##################################################################################
|
||||||
|
# BASE ###########################################################################
|
||||||
|
##################################################################################
|
||||||
FROM node:12.19.0-alpine3.10 as build
|
FROM node:12.19.0-alpine3.10 as build
|
||||||
LABEL Description="Maintenance page of the Social Network ocelot.social" Vendor="ocelot.social Community" Version="0.0.1" Maintainer="ocelot.social Community (devops@ocelot.social)"
|
|
||||||
|
|
||||||
EXPOSE 3000
|
# ENVs
|
||||||
CMD ["yarn", "run", "start"]
|
## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame
|
||||||
|
ENV DOCKER_WORKDIR="/app"
|
||||||
|
## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0
|
||||||
|
ARG BBUILD_DATE="1970-01-01T00:00:00.00Z"
|
||||||
|
ENV BUILD_DATE=$BBUILD_DATE
|
||||||
|
## We cannot do $(yarn run version)-${BUILD_NUMBER} here so we default to 0.0.0-0
|
||||||
|
ARG BBUILD_VERSION="0.0.0-0"
|
||||||
|
ENV BUILD_VERSION=$BBUILD_VERSION
|
||||||
|
## We cannot do `$(git rev-parse --short HEAD)` here so we default to 0000000
|
||||||
|
ARG BBUILD_COMMIT="0000000"
|
||||||
|
ENV BUILD_COMMIT=$BBUILD_COMMIT
|
||||||
|
## SET NODE_ENV
|
||||||
|
ENV NODE_ENV="production"
|
||||||
|
## App relevant Envs
|
||||||
|
ENV PORT="3000"
|
||||||
|
|
||||||
# Expose the app port
|
# Labels
|
||||||
ARG BUILD_COMMIT
|
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
||||||
ENV BUILD_COMMIT=$BUILD_COMMIT
|
LABEL org.label-schema.name="ocelot.social:backend"
|
||||||
ARG WORKDIR=/develop-webapp
|
LABEL org.label-schema.description="Maintenance page of the Social Network Software ocelot.social"
|
||||||
RUN mkdir -p $WORKDIR
|
LABEL org.label-schema.usage="https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/README.md"
|
||||||
WORKDIR $WORKDIR
|
LABEL org.label-schema.url="https://ocelot.social"
|
||||||
|
LABEL org.label-schema.vcs-url="https://github.com/Ocelot-Social-Community/Ocelot-Social/tree/master/backend"
|
||||||
|
LABEL org.label-schema.vcs-ref="${BUILD_COMMIT}"
|
||||||
|
LABEL org.label-schema.vendor="ocelot.social Community"
|
||||||
|
LABEL org.label-schema.version="${BUILD_VERSION}"
|
||||||
|
LABEL org.label-schema.schema-version="1.0"
|
||||||
|
LABEL maintainer="devops@ocelot.social"
|
||||||
|
|
||||||
# See: https://github.com/nodejs/docker-node/pull/367#issuecomment-430807898
|
# Install Additional Software
|
||||||
|
## install: git
|
||||||
RUN apk --no-cache add git
|
RUN apk --no-cache add git
|
||||||
|
|
||||||
|
# Settings
|
||||||
|
## Expose Container Port
|
||||||
|
EXPOSE ${PORT}
|
||||||
|
|
||||||
|
## Workdir
|
||||||
|
RUN mkdir -p ${DOCKER_WORKDIR}
|
||||||
|
WORKDIR ${DOCKER_WORKDIR}
|
||||||
|
|
||||||
|
##################################################################################
|
||||||
|
# PRODUCTION ### TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO ####
|
||||||
|
##################################################################################
|
||||||
|
|
||||||
|
CMD ["yarn", "run", "start"]
|
||||||
|
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn install --production=false --frozen-lockfile --non-interactive
|
RUN yarn install --production=false --frozen-lockfile --non-interactive
|
||||||
|
|
||||||
@ -37,6 +74,6 @@ RUN yarn run generate
|
|||||||
|
|
||||||
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY --from=build ./develop-webapp/dist/ /usr/share/nginx/html/
|
COPY --from=build ./app/dedist/ /usr/share/nginx/html/
|
||||||
RUN rm /etc/nginx/conf.d/default.conf
|
RUN rm /etc/nginx/conf.d/default.conf
|
||||||
COPY maintenance/nginx/custom.conf /etc/nginx/conf.d/
|
COPY maintenance/nginx/custom.conf /etc/nginx/conf.d/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user