Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Community
Technology
Technology Q&A
Best approach to setup mono repo using Docker
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MayoMayn" data-source="post: 438886" data-attributes="member: 71840"><p>So currently I have a mono repository that consists of the structure:</p><p>[CODE]</p><p>+-- project</p><p>| +-- client</p><p>| +-- assets</p><p>| +-- src</p><p>| +-- ...</p><p>| +-- package.json</p><p>| +-- angular.json</p><p>| +-- tsconfig.json</p><p>| +-- Dockerfile</p><p>| +-- ...</p><p>| +-- server</p><p>| +-- database</p><p>| +-- ...</p><p>| +-- src</p><p>| +-- ...</p><p>| +-- package.json</p><p>| +-- .graphqlconfig.yml</p><p>| +-- tsconfig.json</p><p>| +-- tsconfig.build.json</p><p>| +-- Dockerfile</p><p>| +-- ...</p><p>+-- yarn.lock</p><p>+-- package.json</p><p>+-- lerna.json</p><p>+-- tsconfig.json</p><p>+-- tsconfig.base.json</p><p>+-- docker-compose.yml</p><p>[/CODE]</p><p></p><p>And the problem is, that the docker-compose services commands can't figure out the workdirs of the images, so it tries to run the script commands in the root directory of the project.</p><p>Tried to do switch out the bash command with <strong>ls</strong> and it was still in the root directory of the project.</p><p></p><p><strong>project/server/Dockerfile</strong></p><p>[SPOILER]</p><p>[CODE]</p><p>FROM node:alpine</p><p></p><p>ARG NODE_ENV=development</p><p>ENV NODE_ENV=${NODE_ENV}</p><p></p><p>WORKDIR /usr/app/server</p><p></p><p>COPY ./package.json .</p><p># COPY ../../yarn.lock .</p><p>RUN yarn</p><p></p><p>COPY . .</p><p></p><p>EXPOSE 4242</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p><strong>project/client/Dockerfile</strong></p><p>[SPOILER]</p><p>[CODE]</p><p>FROM node:alpine</p><p></p><p>ARG NODE_ENV=development</p><p>ENV NODE_ENV=${NODE_ENV}</p><p></p><p>WORKDIR /usr/app/client</p><p></p><p>COPY ./package.json .</p><p># COPY ../../yarn.lock .</p><p>RUN yarn</p><p></p><p>COPY . .</p><p></p><p>EXPOSE 8080</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p></p><p><strong>docker-compose.yml</strong></p><p>[SPOILER]</p><p>[CODE]</p><p>version: '3'</p><p>volumes:</p><p> postgres:</p><p>services:</p><p> prisma:</p><p> image: prismagraphql/prisma:1.16</p><p> restart: always</p><p> ports:</p><p> - '4466:4466'</p><p> environment:</p><p> PRISMA_CONFIG: |</p><p> port: 4466</p><p> databases:</p><p> default:</p><p> connector: postgres</p><p> host: postgres</p><p> port: 5432</p><p> user: prisma</p><p> password: prisma</p><p> migrations: true</p><p> postgres:</p><p> image: postgres:10.5</p><p> restart: always</p><p> environment:</p><p> POSTGRES_USER: prisma</p><p> POSTGRES_PASSWORD: prisma</p><p> volumes:</p><p> - postgres:/var/lib/postgresql/data</p><p> client:</p><p> container_name: emerald-client</p><p> command: yarn start</p><p> restart: unless-stopped</p><p> image: client</p><p> build:</p><p> context: ./project/client</p><p> dockerfile: Dockerfile</p><p> args:</p><p> - NODE_ENV=development</p><p> ports:</p><p> - '3030:3030'</p><p> volumes:</p><p> - .:/usr/app/client</p><p> server:</p><p> container_name: emerald-server</p><p> command: [sh, -c, 'yarn run prisma deploy && yarn start:dev']</p><p> restart: unless-stopped</p><p> image: server</p><p> depends_on:</p><p> - prisma</p><p> - postgres</p><p> build:</p><p> context: ./project/server</p><p> dockerfile: Dockerfile</p><p> args:</p><p> - NODE_ENV=development</p><p> ports:</p><p> - '4242:4242'</p><p> volumes:</p><p> - .:/usr/app/server</p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p><strong>Error log</strong></p><p>[SPOILER]</p><p>[CODE]</p><p>marcus-sa@DESKTOP-FUHH564:/e/Git/nest-prisma-angular-docker$ docker-compose up --build --remove-orphans</p><p>Building client</p><p>Step 1/9 : FROM node:alpine</p><p> ---> 5ffbcf1d9932</p><p>Step 2/9 : ARG NODE_ENV=development</p><p> ---> Running in 0fa11a29b762</p><p>Removing intermediate container 0fa11a29b762</p><p> ---> a943a9eaa495</p><p>Step 3/9 : ENV NODE_ENV=${NODE_ENV}</p><p> ---> Running in 95e18bc28566</p><p>Removing intermediate container 95e18bc28566</p><p> ---> 349ada5022a1</p><p>Step 4/9 : WORKDIR /usr/app/client</p><p> ---> Running in be4b60c56e33</p><p>Removing intermediate container be4b60c56e33</p><p> ---> ad0c66dbfb9d</p><p>Step 5/9 : COPY ./package.json .</p><p> ---> 4db7715d4607</p><p>Step 6/9 : RUN yarn</p><p> ---> Running in 5c04efc3e1ad</p><p>yarn install v1.9.4</p><p>warning package.json: No license field</p><p>info No lockfile found.</p><p>warning @npa/client@0.0.1: No license field</p><p>[1/4] Resolving packages...</p><p>[2/4] Fetching packages...</p><p>(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.</p><p>info fsevents@1.2.4: The platform "linux" is incompatible with this module.</p><p>info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.</p><p>[3/4] Linking dependencies...</p><p>warning "@angular-devkit/build-angular > @ngtools/webpack@6.2.2" has unmet peer dependency "typescript@~2.4.0 || ~2.5.0 || ~2.6.0 || ~2.7.0 || ~2.8.0 || ~2.9.0".</p><p>warning " > @angular/compiler-cli@6.1.7" has unmet peer dependency "typescript@>=2.7.2 <2.10".</p><p>warning "@angular/compiler-cli > tsickle@0.32.1" has unmet peer dependency "typescript@>=2.4.2 <2.10".</p><p>warning " > apollo-angular@1.3.0" has unmet peer dependency "apollo-link@^1.0.0".</p><p>warning " > apollo-angular-link-http@1.2.0" has unmet peer dependency "apollo-link@^1.0.0".</p><p>warning " > apollo-angular-link-http@1.2.0" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0".</p><p>warning "apollo-angular-link-http > apollo-angular-link-http-common@1.2.0" has unmet peer dependency "apollo-link@^1.0.0".</p><p>warning "apollo-angular-link-http > apollo-angular-link-http-common@1.2.0" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0".</p><p>warning " > apollo-cache-inmemory@1.2.10" has unmet peer dependency "graphql@0.11.7 || ^0.12.0 || ^0.13.0".</p><p>warning " > apollo-client@2.4.2" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0".</p><p>warning "apollo-client > apollo-link@1.2.3" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0".</p><p>[4/4] Building fresh packages...</p><p>success Saved lockfile.</p><p>Done in 39.46s.</p><p>Removing intermediate container 5c04efc3e1ad</p><p> ---> 1390d02cb152</p><p>Step 7/9 : COPY . .</p><p> ---> 66ce4136a1c7</p><p>Step 8/9 : EXPOSE 8080</p><p> ---> Running in c308b6ef13fa</p><p>Removing intermediate container c308b6ef13fa</p><p> ---> 288e619440e4</p><p>Step 9/9 : RUN set -ex; if ["$NODE_ENV" = "production"]; then yarn build:prod fi;</p><p> ---> Running in 3211c43f09c6</p><p>/bin/sh: syntax error: unexpected end of file (expecting "fi")</p><p>ERROR: Service 'client' failed to build: The command '/bin/sh -c set -ex; if ["$NODE_ENV" = "production"]; then yarn build:prod fi;' returned a non-zero code: 2</p><p>marcus-sa@DESKTOP-FUHH564:/e/Git/nest-prisma-angular-docker$ docker-compose up --build --remove-orphans</p><p>Building client</p><p>Step 1/9 : FROM node:alpine</p><p> ---> 5ffbcf1d9932</p><p>Step 2/9 : ARG NODE_ENV=development</p><p> ---> Using cache</p><p> ---> a943a9eaa495</p><p>Step 3/9 : ENV NODE_ENV=${NODE_ENV}</p><p> ---> Using cache</p><p> ---> 349ada5022a1</p><p>Step 4/9 : WORKDIR /usr/app/client</p><p> ---> Using cache</p><p> ---> ad0c66dbfb9d</p><p>Step 5/9 : COPY ./package.json .</p><p> ---> Using cache</p><p> ---> 4db7715d4607</p><p>Step 6/9 : RUN yarn</p><p> ---> Using cache</p><p> ---> 1390d02cb152</p><p>Step 7/9 : COPY . .</p><p> ---> bfdd009dc792</p><p>Step 8/9 : EXPOSE 8080</p><p> ---> Running in b50726163591</p><p>Removing intermediate container b50726163591</p><p> ---> 78fa6f2af004</p><p>Step 9/9 : RUN set -ex; if ["$NODE_ENV" = "production"]; then yarn build:prod; fi;</p><p> ---> Running in 54b5e0bea7e3</p><p>+ '[development' '=' production]</p><p>/bin/sh: [development: not found</p><p>Removing intermediate container 54b5e0bea7e3</p><p> ---> 9a3b15ea99b3</p><p>Successfully built 9a3b15ea99b3</p><p>Successfully tagged client:latest</p><p>Building server</p><p>Step 1/9 : FROM node:alpine</p><p> ---> 5ffbcf1d9932</p><p>Step 2/9 : ARG NODE_ENV=development</p><p> ---> Using cache</p><p> ---> a943a9eaa495</p><p>Step 3/9 : ENV NODE_ENV=${NODE_ENV}</p><p> ---> Using cache</p><p> ---> 349ada5022a1</p><p>Step 4/9 : WORKDIR /usr/app/server</p><p> ---> Running in 97c12e798c88</p><p>Removing intermediate container 97c12e798c88</p><p> ---> b9d853e03877</p><p>Step 5/9 : COPY ./package.json .</p><p> ---> e9ce8755780b</p><p>Step 6/9 : RUN yarn</p><p> ---> Running in ba56cf48b5a8</p><p>yarn install v1.9.4</p><p>warning package.json: No license field</p><p>info No lockfile found.</p><p>warning @npa/server@0.0.1: No license field</p><p>[1/4] Resolving packages...</p><p>[2/4] Fetching packages...</p><p>(node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.</p><p>info fsevents@1.2.4: The platform "linux" is incompatible with this module.</p><p>info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.</p><p>[3/4] Linking dependencies...</p><p>warning "@nestjs/graphql > merge-graphql-schemas@1.5.4" has incorrect peer dependency "graphql@^0.11.7 || ^0.13.0".</p><p>warning " > graphql-tools@3.1.1" has incorrect peer dependency "graphql@^0.13.0".</p><p>warning "apollo-server-express > graphql-subscriptions@0.5.8" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0".</p><p>warning "apollo-server-express > apollo-server-core > graphql-tag@2.9.2" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0".</p><p>warning "apollo-server-express > @apollographql/apollo-upload-server@5.0.3" has incorrect peer dependency "graphql@^0.13.1".</p><p>warning "prisma > prisma-cli-core@1.0.79" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0".</p><p>warning " > prisma-binding@2.1.5" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0".</p><p>warning "prisma-binding > apollo-link@1.2.2" has incorrect peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0".</p><p>warning "prisma-binding > graphql-import@0.5.2" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0".</p><p>warning "prisma-binding > graphql-tools@3.1.0" has incorrect peer dependency "graphql@^0.13.0".</p><p>warning "prisma-binding > subscriptions-transport-ws@0.9.8" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.1".</p><p>warning "prisma-binding > graphql-binding@2.2.4" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0".</p><p>warning "prisma-binding > graphql-binding > graphql-import@0.5.3" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0".</p><p>[4/4] Building fresh packages...</p><p>success Saved lockfile.</p><p>Done in 36.16s.</p><p>Removing intermediate container ba56cf48b5a8</p><p> ---> 6da36da96c51</p><p>Step 7/9 : COPY . .</p><p> ---> 5cbf9f43aaf3</p><p>Step 8/9 : EXPOSE 4242</p><p> ---> Running in 3b724af3f3a4</p><p>Removing intermediate container 3b724af3f3a4</p><p> ---> dc2f82318399</p><p>Step 9/9 : RUN set -ex; if ["$NODE_ENV" = "production"]; then yarn build; fi;</p><p> ---> Running in 7d318d723049</p><p>+ '[development' '=' production]</p><p>/bin/sh: [development: not found</p><p>Removing intermediate container 7d318d723049</p><p> ---> a37ec2260c27</p><p>Successfully built a37ec2260c27</p><p>Successfully tagged server:latest</p><p>Starting nest-prisma-angular-docker_prisma_1 ... done</p><p>Recreating nest-prisma-angular-docker_client_1 ... done</p><p>Starting nest-prisma-angular-docker_postgres_1 ... done</p><p>Recreating nest-prisma-angular-docker_server_1 ... done</p><p>Attaching to nest-prisma-angular-docker_prisma_1, nest-prisma-angular-docker_postgres_1, emerald-client, emerald-server</p><p>postgres_1 | 2018-09-18 22:00:27.700 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432</p><p>postgres_1 | 2018-09-18 22:00:27.700 UTC [1] LOG: listening on IPv6 address "::", port 5432</p><p>emerald-client | yarn run v1.9.4</p><p>emerald-server | yarn run v1.9.4</p><p>postgres_1 | 2018-09-18 22:00:27.738 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"</p><p>postgres_1 | 2018-09-18 22:00:27.786 UTC [26] LOG: database system was interrupted; last known up at 2018-09-18 21:50:54 UTC</p><p>emerald-client | error Command "start" not found.</p><p>emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy</p><p>emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found</p><p>emerald-server | error Command failed with exit code 127.</p><p>emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>postgres_1 | 2018-09-18 22:00:28.911 UTC [26] LOG: database system was not properly shut down; automatic recovery in progress</p><p>postgres_1 | 2018-09-18 22:00:28.924 UTC [26] LOG: invalid record length at 0/1677BC0: wanted 24, got 0</p><p>postgres_1 | 2018-09-18 22:00:28.924 UTC [26] LOG: redo is not required</p><p>postgres_1 | 2018-09-18 22:00:29.040 UTC [1] LOG: database system is ready to accept connections</p><p>postgres_1 | 2018-09-18 22:00:32.554 UTC [34] ERROR: database "prisma" already exists</p><p>postgres_1 | 2018-09-18 22:00:32.554 UTC [34] STATEMENT: CREATE DATABASE "prisma"</p><p>emerald-client exited with code 1</p><p>emerald-server exited with code 1</p><p>prisma_1 | Obtaining exclusive agent lock...</p><p>prisma_1 | Obtaining exclusive agent lock... Successful.</p><p>prisma_1 | Deployment worker initialization complete.</p><p>postgres_1 | 2018-09-18 22:00:33.605 UTC [33] ERROR: null value in column "lastPinged" violates not-null constraint</p><p>postgres_1 | 2018-09-18 22:00:33.605 UTC [33] DETAIL: Failing row contains (2d4cea92-4c6c-4c06-80a5-6632fd665a63, null).</p><p>postgres_1 | 2018-09-18 22:00:33.605 UTC [33] STATEMENT: insert into "TelemetryInfo" ("id","lastPinged") values ($1,$2)</p><p>prisma_1 | Initializing workers...</p><p>prisma_1 | Successfully started 1 workers.</p><p>emerald-client | yarn run v1.9.4</p><p>emerald-client | error Command "start" not found.</p><p>emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>emerald-client | yarn run v1.9.4</p><p>emerald-client | error Command "start" not found.</p><p>emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>emerald-server | yarn run v1.9.4</p><p>emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy</p><p>emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found</p><p>emerald-server | error Command failed with exit code 127.</p><p>emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>emerald-server | yarn run v1.9.4</p><p>emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy</p><p>emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found</p><p>emerald-server | error Command failed with exit code 127.</p><p>emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>prisma_1 | Server running on :4466</p><p>emerald-server | yarn run v1.9.4</p><p>emerald-client | yarn run v1.9.4</p><p>emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy</p><p>emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found</p><p>emerald-server | error Command failed with exit code 127.</p><p>emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>emerald-client | error Command "start" not found.</p><p>emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.</p><p>prisma_1 | Version is up to date.</p><p></p><p>[/CODE]</p><p>[/SPOILER]</p><p></p><p>So my question is, what would be the best approach to resolve what I'm trying to accomplish?</p><p>I did find this <a href="https://stackoverflow.com/questions/51178504/docker-compose-file-with-yarn-monorepo" target="_blank">https://stackoverflow.com/questions/51178504/docker-compose-file-with-yarn-monorepo</a> but doesn't seem like the most convenient solution (which didn't work either)</p></blockquote><p></p>
[QUOTE="MayoMayn, post: 438886, member: 71840"] So currently I have a mono repository that consists of the structure: [CODE] +-- project | +-- client | +-- assets | +-- src | +-- ... | +-- package.json | +-- angular.json | +-- tsconfig.json | +-- Dockerfile | +-- ... | +-- server | +-- database | +-- ... | +-- src | +-- ... | +-- package.json | +-- .graphqlconfig.yml | +-- tsconfig.json | +-- tsconfig.build.json | +-- Dockerfile | +-- ... +-- yarn.lock +-- package.json +-- lerna.json +-- tsconfig.json +-- tsconfig.base.json +-- docker-compose.yml [/CODE] And the problem is, that the docker-compose services commands can't figure out the workdirs of the images, so it tries to run the script commands in the root directory of the project. Tried to do switch out the bash command with [B]ls[/B] and it was still in the root directory of the project. [B]project/server/Dockerfile[/B] [SPOILER] [CODE] FROM node:alpine ARG NODE_ENV=development ENV NODE_ENV=${NODE_ENV} WORKDIR /usr/app/server COPY ./package.json . # COPY ../../yarn.lock . RUN yarn COPY . . EXPOSE 4242 [/CODE] [/SPOILER] [B]project/client/Dockerfile[/B] [SPOILER] [CODE] FROM node:alpine ARG NODE_ENV=development ENV NODE_ENV=${NODE_ENV} WORKDIR /usr/app/client COPY ./package.json . # COPY ../../yarn.lock . RUN yarn COPY . . EXPOSE 8080 [/CODE] [/SPOILER] [B]docker-compose.yml[/B] [SPOILER] [CODE] version: '3' volumes: postgres: services: prisma: image: prismagraphql/prisma:1.16 restart: always ports: - '4466:4466' environment: PRISMA_CONFIG: | port: 4466 databases: default: connector: postgres host: postgres port: 5432 user: prisma password: prisma migrations: true postgres: image: postgres:10.5 restart: always environment: POSTGRES_USER: prisma POSTGRES_PASSWORD: prisma volumes: - postgres:/var/lib/postgresql/data client: container_name: emerald-client command: yarn start restart: unless-stopped image: client build: context: ./project/client dockerfile: Dockerfile args: - NODE_ENV=development ports: - '3030:3030' volumes: - .:/usr/app/client server: container_name: emerald-server command: [sh, -c, 'yarn run prisma deploy && yarn start:dev'] restart: unless-stopped image: server depends_on: - prisma - postgres build: context: ./project/server dockerfile: Dockerfile args: - NODE_ENV=development ports: - '4242:4242' volumes: - .:/usr/app/server [/CODE] [/SPOILER] [B]Error log[/B] [SPOILER] [CODE] marcus-sa@DESKTOP-FUHH564:/e/Git/nest-prisma-angular-docker$ docker-compose up --build --remove-orphans Building client Step 1/9 : FROM node:alpine ---> 5ffbcf1d9932 Step 2/9 : ARG NODE_ENV=development ---> Running in 0fa11a29b762 Removing intermediate container 0fa11a29b762 ---> a943a9eaa495 Step 3/9 : ENV NODE_ENV=${NODE_ENV} ---> Running in 95e18bc28566 Removing intermediate container 95e18bc28566 ---> 349ada5022a1 Step 4/9 : WORKDIR /usr/app/client ---> Running in be4b60c56e33 Removing intermediate container be4b60c56e33 ---> ad0c66dbfb9d Step 5/9 : COPY ./package.json . ---> 4db7715d4607 Step 6/9 : RUN yarn ---> Running in 5c04efc3e1ad yarn install v1.9.4 warning package.json: No license field info No lockfile found. warning @npa/client@0.0.1: No license field [1/4] Resolving packages... [2/4] Fetching packages... (node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. info fsevents@1.2.4: The platform "linux" is incompatible with this module. info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning "@angular-devkit/build-angular > @ngtools/webpack@6.2.2" has unmet peer dependency "typescript@~2.4.0 || ~2.5.0 || ~2.6.0 || ~2.7.0 || ~2.8.0 || ~2.9.0". warning " > @angular/compiler-cli@6.1.7" has unmet peer dependency "typescript@>=2.7.2 <2.10". warning "@angular/compiler-cli > tsickle@0.32.1" has unmet peer dependency "typescript@>=2.4.2 <2.10". warning " > apollo-angular@1.3.0" has unmet peer dependency "apollo-link@^1.0.0". warning " > apollo-angular-link-http@1.2.0" has unmet peer dependency "apollo-link@^1.0.0". warning " > apollo-angular-link-http@1.2.0" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0". warning "apollo-angular-link-http > apollo-angular-link-http-common@1.2.0" has unmet peer dependency "apollo-link@^1.0.0". warning "apollo-angular-link-http > apollo-angular-link-http-common@1.2.0" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0". warning " > apollo-cache-inmemory@1.2.10" has unmet peer dependency "graphql@0.11.7 || ^0.12.0 || ^0.13.0". warning " > apollo-client@2.4.2" has unmet peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0". warning "apollo-client > apollo-link@1.2.3" has unmet peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0 || ^14.0.0". [4/4] Building fresh packages... success Saved lockfile. Done in 39.46s. Removing intermediate container 5c04efc3e1ad ---> 1390d02cb152 Step 7/9 : COPY . . ---> 66ce4136a1c7 Step 8/9 : EXPOSE 8080 ---> Running in c308b6ef13fa Removing intermediate container c308b6ef13fa ---> 288e619440e4 Step 9/9 : RUN set -ex; if ["$NODE_ENV" = "production"]; then yarn build:prod fi; ---> Running in 3211c43f09c6 /bin/sh: syntax error: unexpected end of file (expecting "fi") ERROR: Service 'client' failed to build: The command '/bin/sh -c set -ex; if ["$NODE_ENV" = "production"]; then yarn build:prod fi;' returned a non-zero code: 2 marcus-sa@DESKTOP-FUHH564:/e/Git/nest-prisma-angular-docker$ docker-compose up --build --remove-orphans Building client Step 1/9 : FROM node:alpine ---> 5ffbcf1d9932 Step 2/9 : ARG NODE_ENV=development ---> Using cache ---> a943a9eaa495 Step 3/9 : ENV NODE_ENV=${NODE_ENV} ---> Using cache ---> 349ada5022a1 Step 4/9 : WORKDIR /usr/app/client ---> Using cache ---> ad0c66dbfb9d Step 5/9 : COPY ./package.json . ---> Using cache ---> 4db7715d4607 Step 6/9 : RUN yarn ---> Using cache ---> 1390d02cb152 Step 7/9 : COPY . . ---> bfdd009dc792 Step 8/9 : EXPOSE 8080 ---> Running in b50726163591 Removing intermediate container b50726163591 ---> 78fa6f2af004 Step 9/9 : RUN set -ex; if ["$NODE_ENV" = "production"]; then yarn build:prod; fi; ---> Running in 54b5e0bea7e3 + '[development' '=' production] /bin/sh: [development: not found Removing intermediate container 54b5e0bea7e3 ---> 9a3b15ea99b3 Successfully built 9a3b15ea99b3 Successfully tagged client:latest Building server Step 1/9 : FROM node:alpine ---> 5ffbcf1d9932 Step 2/9 : ARG NODE_ENV=development ---> Using cache ---> a943a9eaa495 Step 3/9 : ENV NODE_ENV=${NODE_ENV} ---> Using cache ---> 349ada5022a1 Step 4/9 : WORKDIR /usr/app/server ---> Running in 97c12e798c88 Removing intermediate container 97c12e798c88 ---> b9d853e03877 Step 5/9 : COPY ./package.json . ---> e9ce8755780b Step 6/9 : RUN yarn ---> Running in ba56cf48b5a8 yarn install v1.9.4 warning package.json: No license field info No lockfile found. warning @npa/server@0.0.1: No license field [1/4] Resolving packages... [2/4] Fetching packages... (node:1) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. info fsevents@1.2.4: The platform "linux" is incompatible with this module. info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning "@nestjs/graphql > merge-graphql-schemas@1.5.4" has incorrect peer dependency "graphql@^0.11.7 || ^0.13.0". warning " > graphql-tools@3.1.1" has incorrect peer dependency "graphql@^0.13.0". warning "apollo-server-express > graphql-subscriptions@0.5.8" has incorrect peer dependency "graphql@^0.10.5 || ^0.11.3 || ^0.12.0 || ^0.13.0". warning "apollo-server-express > apollo-server-core > graphql-tag@2.9.2" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0". warning "apollo-server-express > @apollographql/apollo-upload-server@5.0.3" has incorrect peer dependency "graphql@^0.13.1". warning "prisma > prisma-cli-core@1.0.79" has incorrect peer dependency "graphql@^0.12.0 || ^0.13.0". warning " > prisma-binding@2.1.5" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0". warning "prisma-binding > apollo-link@1.2.2" has incorrect peer dependency "graphql@^0.11.3 || ^0.12.3 || ^0.13.0". warning "prisma-binding > graphql-import@0.5.2" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0". warning "prisma-binding > graphql-tools@3.1.0" has incorrect peer dependency "graphql@^0.13.0". warning "prisma-binding > subscriptions-transport-ws@0.9.8" has incorrect peer dependency "graphql@^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.1". warning "prisma-binding > graphql-binding@2.2.4" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0". warning "prisma-binding > graphql-binding > graphql-import@0.5.3" has incorrect peer dependency "graphql@^0.11.0 || ^0.12.0 || ^0.13.0". [4/4] Building fresh packages... success Saved lockfile. Done in 36.16s. Removing intermediate container ba56cf48b5a8 ---> 6da36da96c51 Step 7/9 : COPY . . ---> 5cbf9f43aaf3 Step 8/9 : EXPOSE 4242 ---> Running in 3b724af3f3a4 Removing intermediate container 3b724af3f3a4 ---> dc2f82318399 Step 9/9 : RUN set -ex; if ["$NODE_ENV" = "production"]; then yarn build; fi; ---> Running in 7d318d723049 + '[development' '=' production] /bin/sh: [development: not found Removing intermediate container 7d318d723049 ---> a37ec2260c27 Successfully built a37ec2260c27 Successfully tagged server:latest Starting nest-prisma-angular-docker_prisma_1 ... done Recreating nest-prisma-angular-docker_client_1 ... done Starting nest-prisma-angular-docker_postgres_1 ... done Recreating nest-prisma-angular-docker_server_1 ... done Attaching to nest-prisma-angular-docker_prisma_1, nest-prisma-angular-docker_postgres_1, emerald-client, emerald-server postgres_1 | 2018-09-18 22:00:27.700 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres_1 | 2018-09-18 22:00:27.700 UTC [1] LOG: listening on IPv6 address "::", port 5432 emerald-client | yarn run v1.9.4 emerald-server | yarn run v1.9.4 postgres_1 | 2018-09-18 22:00:27.738 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres_1 | 2018-09-18 22:00:27.786 UTC [26] LOG: database system was interrupted; last known up at 2018-09-18 21:50:54 UTC emerald-client | error Command "start" not found. emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found emerald-server | error Command failed with exit code 127. emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. postgres_1 | 2018-09-18 22:00:28.911 UTC [26] LOG: database system was not properly shut down; automatic recovery in progress postgres_1 | 2018-09-18 22:00:28.924 UTC [26] LOG: invalid record length at 0/1677BC0: wanted 24, got 0 postgres_1 | 2018-09-18 22:00:28.924 UTC [26] LOG: redo is not required postgres_1 | 2018-09-18 22:00:29.040 UTC [1] LOG: database system is ready to accept connections postgres_1 | 2018-09-18 22:00:32.554 UTC [34] ERROR: database "prisma" already exists postgres_1 | 2018-09-18 22:00:32.554 UTC [34] STATEMENT: CREATE DATABASE "prisma" emerald-client exited with code 1 emerald-server exited with code 1 prisma_1 | Obtaining exclusive agent lock... prisma_1 | Obtaining exclusive agent lock... Successful. prisma_1 | Deployment worker initialization complete. postgres_1 | 2018-09-18 22:00:33.605 UTC [33] ERROR: null value in column "lastPinged" violates not-null constraint postgres_1 | 2018-09-18 22:00:33.605 UTC [33] DETAIL: Failing row contains (2d4cea92-4c6c-4c06-80a5-6632fd665a63, null). postgres_1 | 2018-09-18 22:00:33.605 UTC [33] STATEMENT: insert into "TelemetryInfo" ("id","lastPinged") values ($1,$2) prisma_1 | Initializing workers... prisma_1 | Successfully started 1 workers. emerald-client | yarn run v1.9.4 emerald-client | error Command "start" not found. emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. emerald-client | yarn run v1.9.4 emerald-client | error Command "start" not found. emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. emerald-server | yarn run v1.9.4 emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found emerald-server | error Command failed with exit code 127. emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. emerald-server | yarn run v1.9.4 emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found emerald-server | error Command failed with exit code 127. emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. prisma_1 | Server running on :4466 emerald-server | yarn run v1.9.4 emerald-client | yarn run v1.9.4 emerald-server | $ /usr/app/server/node_modules/.bin/prisma deploy emerald-server | /bin/sh: /usr/app/server/node_modules/.bin/prisma: not found emerald-server | error Command failed with exit code 127. emerald-server | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. emerald-client | error Command "start" not found. emerald-client | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. prisma_1 | Version is up to date. [/CODE] [/SPOILER] So my question is, what would be the best approach to resolve what I'm trying to accomplish? I did find this [URL]https://stackoverflow.com/questions/51178504/docker-compose-file-with-yarn-monorepo[/URL] but doesn't seem like the most convenient solution (which didn't work either) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Community
Technology
Technology Q&A
Best approach to setup mono repo using Docker
Top