From b62166abda0bc4507d78f14829f4396be567b8ea Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Sun, 6 Dec 2020 06:26:43 -0500 Subject: [PATCH] ui container fixes --- .prettierignore | 3 +- hack/dockerfiles/ui.Dockerfile | 9 +++-- package.json | 13 ++++--- terraform/webapp.tf | 2 +- yarn.lock | 67 ++++++---------------------------- 5 files changed, 27 insertions(+), 67 deletions(-) diff --git a/.prettierignore b/.prettierignore index bbf26c9..d48a892 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,4 +3,5 @@ dist storybook-static .next worker -**/dist \ No newline at end of file +**/dist +terraform \ No newline at end of file diff --git a/hack/dockerfiles/ui.Dockerfile b/hack/dockerfiles/ui.Dockerfile index d511319..f4e4a00 100644 --- a/hack/dockerfiles/ui.Dockerfile +++ b/hack/dockerfiles/ui.Dockerfile @@ -1,5 +1,6 @@ FROM node:14-alpine AS base WORKDIR /src +ENTRYPOINT [] # # Builder @@ -9,17 +10,17 @@ FROM base AS builder COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile -COPY . . -RUN yarn ui:build +COPY tsconfig.json .babelrc.js next.config.js next-env.d.ts ./ +COPY src src -RUN yarn install --frozen-lockfile --prod +RUN yarn ui:build # # Output layer # FROM base AS output -COPY --from=builder /src/.next /src/node_modules ./ +COPY --from=builder /src . EXPOSE 3000 CMD yarn ui:prod diff --git a/package.json b/package.json index 7428a0e..e410781 100644 --- a/package.json +++ b/package.json @@ -2,22 +2,23 @@ "name": "roleypoly", "version": "1.0.0", "description": "https://roleypoly.com", - "homepage": "https://github.com/roleypoly/roleypoly#readme", - "bugs": { - "url": "https://github.com/roleypoly/roleypoly/issues" - }, "repository": { "type": "git", "url": "git+https://github.com/roleypoly/roleypoly.git" }, - "license": "MIT", + "homepage": "https://github.com/roleypoly/roleypoly#readme", + "bugs": { + "url": "https://github.com/roleypoly/roleypoly/issues" + }, "author": "Katalina Okano ", + "license": "MIT", "scripts": { "lint": "run-p -c lint:* --", "lint:eslint": "eslint", "lint:go": "go fmt ./...", "lint:prettier": "cross-env prettier -c '**/*.{ts,tsx,css,yml,yaml,md,json,js,jsx,sh,gitignore,mdx,Dockerfile}'", "lint:stylelint": "cross-env stylelint '**/*.{ts,tsx}'", + "lint:terraform": "terraform fmt -recursive -check ./terraform", "lint:types": "tsc --noEmit", "now-build": "run-s storybook:build", "storybook": "start-storybook -p 6006", @@ -88,7 +89,7 @@ "npm-run-all": "^4.1.5", "prettier": "^2.2.1", "prettier-plugin-organize-imports": "^1.1.1", - "prettier-plugin-packagejson": "^2.2.8", + "prettier-plugin-pkg": "^0.8.0", "prettier-plugin-sh": "^0.6.0", "stylelint": "^13.8.0", "stylelint-config-prettier": "^8.0.2", diff --git a/terraform/webapp.tf b/terraform/webapp.tf index 6a6e0e0..94d6d3e 100644 --- a/terraform/webapp.tf +++ b/terraform/webapp.tf @@ -15,7 +15,7 @@ resource "google_cloud_run_service" "web" { template { spec { containers { - image = "ghcr.io/roleypoly/ui:${var.ui_tag}" + image = "us-docker.pkg.dev/roleypoly/roleypoly/ui:${var.ui_tag}" env { name = "API_PUBLIC_URI" diff --git a/yarn.lock b/yarn.lock index 5e298f8..86dc087 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5356,17 +5356,12 @@ detab@2.0.4: dependencies: repeat-string "^1.5.4" -detect-indent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.0.0.tgz#0abd0f549f69fc6659a254fe96786186b6f528fd" - integrity sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA== - detect-libc@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups= -detect-newline@3.1.0, detect-newline@^3.0.0: +detect-newline@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== @@ -6428,7 +6423,7 @@ fast-glob@^2.0.2, fast-glob@^2.2.6: merge2 "^1.2.3" micromatch "^3.1.10" -fast-glob@^3.0.3, fast-glob@^3.1.1, fast-glob@^3.2.4: +fast-glob@^3.1.1, fast-glob@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== @@ -6888,11 +6883,6 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -git-hooks-list@1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/git-hooks-list/-/git-hooks-list-1.0.3.tgz#be5baaf78203ce342f2f844a9d2b03dba1b45156" - integrity sha512-Y7wLWcrLUXwk2noSka166byGCvhMtDRpgHdzCno1UQv/n/Hegp++a2xBWJL1lJarnKD3SWaljD+0z1ztqxuKyQ== - github-from-package@0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" @@ -7007,20 +6997,6 @@ globalthis@^1.0.0: dependencies: define-properties "^1.1.3" -globby@10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.0.tgz#abfcd0630037ae174a88590132c2f6804e291072" - integrity sha512-3LifW9M4joGZasyYPz2A1U74zbC/45fvpXUvO/9KbSa+VV0aGZarWkfdgKyR9sExNP0t0x0ss/UMJpNpcaTspw== - dependencies: - "@types/glob" "^7.1.1" - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.0.3" - glob "^7.1.3" - ignore "^5.1.1" - merge2 "^1.2.3" - slash "^3.0.0" - globby@8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/globby/-/globby-8.0.2.tgz#5697619ccd95c5275dbb2d6faa42087c1a941d8d" @@ -7489,7 +7465,7 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== -ignore@^5.1.1, ignore@^5.1.4, ignore@^5.1.8: +ignore@^5.1.4, ignore@^5.1.8: version "5.1.8" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== @@ -7936,16 +7912,16 @@ is-object@^1.0.1: resolved "https://registry.yarnpkg.com/is-object/-/is-object-1.0.2.tgz#a56552e1c665c9e950b4a025461da87e72f86fcf" integrity sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA== -is-plain-obj@2.1.0, is-plain-obj@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" - integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== - is-plain-obj@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4= +is-plain-obj@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + is-plain-object@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.1.tgz#662d92d24c0aa4302407b0d45d21f2251c85f85b" @@ -10832,12 +10808,10 @@ prettier-plugin-organize-imports@^1.1.1: resolved "https://registry.yarnpkg.com/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-1.1.1.tgz#7f1ac1a13d4d1752dc16881894dde1c10ccbf3c0" integrity sha512-rFA1lnek1FYkMGthm4xBKME41qUKItTovuo24bCGZu/Vu1n3gW71UPLAkIdwewwkZCe29gRVweSOPXvAdckFuw== -prettier-plugin-packagejson@^2.2.8: - version "2.2.8" - resolved "https://registry.yarnpkg.com/prettier-plugin-packagejson/-/prettier-plugin-packagejson-2.2.8.tgz#aa20997c8569415bc1f0e56f0c73265a927cd3da" - integrity sha512-hc9sg5wgMyefVglP1Sabv3M8EFMH7IPN3WHB5gZRebsbxxHGz0ApW3siMwj7oKqqQPf+qDHAec6alFixuZtGXg== - dependencies: - sort-package-json "1.48.0" +prettier-plugin-pkg@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/prettier-plugin-pkg/-/prettier-plugin-pkg-0.8.0.tgz#379ca5c21a08e8e978a9d0ee0220fe9db36908f7" + integrity sha512-o0+gQDn7yQHFB4k667+aZLDuXlefCDzH00A+ExBlHx//CB9Wuj1lw935Hqu0PxGu+PXItsWlIr/wJZmdi8SGeg== prettier-plugin-sh@^0.6.0: version "0.6.0" @@ -12344,23 +12318,6 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -sort-object-keys@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/sort-object-keys/-/sort-object-keys-1.1.3.tgz#bff833fe85cab147b34742e45863453c1e190b45" - integrity sha512-855pvK+VkU7PaKYPc+Jjnmt4EzejQHyhhF33q31qG8x7maDzkeFhAAThdCYay11CISO+qAMwjOBP+fPZe0IPyg== - -sort-package-json@1.48.0: - version "1.48.0" - resolved "https://registry.yarnpkg.com/sort-package-json/-/sort-package-json-1.48.0.tgz#476043cdde65346900296d5035a0b20560c954e5" - integrity sha512-VAC5THvyGFQFeVLbKcGNPzny5u/heOwks9tzTTLvL8nX9v7zZjpx36/itcJtqp8gI+r57Rw1RVYT6Ecy+3N6+Q== - dependencies: - detect-indent "^6.0.0" - detect-newline "3.1.0" - git-hooks-list "1.0.3" - globby "10.0.0" - is-plain-obj "2.1.0" - sort-object-keys "^1.1.3" - source-list-map@^2.0.0, source-list-map@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"