diff --git a/backend/Dockerfile b/backend/Dockerfile index 250ee845b..75f5a762f 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -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 diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 32ed3ab92..d4b06fc7a 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -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: diff --git a/docker-compose.travis.yml b/docker-compose.travis.yml index 0c6576ca7..4a1acb96a 100644 --- a/docker-compose.travis.yml +++ b/docker-compose.travis.yml @@ -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: diff --git a/docker-compose.yml b/docker-compose.yml index 3b147c631..45e2cdfdf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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" diff --git a/webapp/Dockerfile b/webapp/Dockerfile index cf9c4c698..2fb807501 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -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