mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Here are the issues * webapp was built with `NODE_ENV=production` but started with `NODE_ENV=development` * using the provided `docker-compose.travis.yml` the command `yarn run start` would look in the wrong folder * removed duplicate environment definition
28 lines
851 B
Docker
28 lines
851 B
Docker
FROM node:12.10.0-alpine as base
|
|
LABEL Description="Web Frontend of the Social Network Human-Connection.org" Vendor="Human-Connection gGmbH" Version="0.0.1" Maintainer="Human-Connection gGmbH (developer@human-connection.org)"
|
|
|
|
EXPOSE 3000
|
|
CMD ["yarn", "run", "start"]
|
|
|
|
# Expose the app port
|
|
ARG BUILD_COMMIT
|
|
ENV BUILD_COMMIT=$BUILD_COMMIT
|
|
ARG WORKDIR=/nitro-web
|
|
RUN mkdir -p $WORKDIR
|
|
WORKDIR $WORKDIR
|
|
|
|
# See: https://github.com/nodejs/docker-node/pull/367#issuecomment-430807898
|
|
RUN apk --no-cache add git
|
|
|
|
COPY . .
|
|
|
|
FROM base as build-and-test
|
|
RUN cp .env.template .env
|
|
RUN yarn install --production=false --frozen-lockfile --non-interactive
|
|
RUN NODE_ENV=production yarn run build
|
|
|
|
FROM base as production
|
|
ENV NODE_ENV=production
|
|
COPY --from=build-and-test ./nitro-web/node_modules ./node_modules
|
|
COPY --from=build-and-test ./nitro-web/.nuxt ./.nuxt
|