Fix build

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
This commit is contained in:
roschaefer 2019-09-10 23:56:10 +02:00
parent 8bf11b18aa
commit 5cf82d5e18
5 changed files with 5 additions and 7 deletions

View File

@ -15,10 +15,10 @@ COPY .env.template .env
CMD ["yarn", "run", "start"]
FROM base as builder
RUN yarn install --frozen-lockfile --non-interactive
RUN yarn install --production=false --frozen-lockfile --non-interactive
COPY . .
RUN cp .env.template .env
RUN yarn run build
RUN NODE_ENV=production yarn run build
# reduce image size with a multistage build
FROM base as production

View File

@ -15,7 +15,8 @@ services:
- ./webapp:/nitro-web
- webapp_node_modules:/nitro-web/node_modules
command: yarn run dev
user: root
environment:
- NUXT_BUILD=.nuxt-dist # avoid file ownership issues with shared folders
factories:
image: humanconnection/nitro-backend:builder
build:

View File

@ -14,8 +14,6 @@ services:
volumes:
#/nitro-web
- ./webapp/coverage:/nitro-web/coverage
environment:
- GRAPHQL_URI=http://backend:4000
backend:
image: humanconnection/nitro-backend:builder
build:

View File

@ -12,7 +12,6 @@ services:
networks:
- hc-network
environment:
- NUXT_BUILD=.nuxt-dist
- HOST=0.0.0.0
- GRAPHQL_URI=http://backend:4000
- MAPBOX_TOKEN="pk.eyJ1IjoiaHVtYW4tY29ubmVjdGlvbiIsImEiOiJjajl0cnBubGoweTVlM3VwZ2lzNTNud3ZtIn0.bZ8KK9l70omjXbEkkbHGsQ"

View File

@ -19,7 +19,7 @@ COPY . .
FROM base as build-and-test
RUN cp .env.template .env
RUN yarn install --production=false --frozen-lockfile --non-interactive
RUN yarn run build
RUN NODE_ENV=production yarn run build
FROM base as production
ENV NODE_ENV=production