diff --git a/docker-compose.accounts.yml b/docker-compose.accounts.yml index 5d9d345c..73953a57 100644 --- a/docker-compose.accounts.yml +++ b/docker-compose.accounts.yml @@ -75,3 +75,25 @@ services: - 3000 depends_on: - mongo + + dashboard-v2: + build: + context: ./packages/dashboard-v2 + dockerfile: Dockerfile + container_name: dashboard-v2 + restart: unless-stopped + logging: *default-logging + env_file: + - .env + environment: + - GATSBY_PORTAL_DOMAIN=${PORTAL_DOMAIN} + volumes: + - ./docker/data/dashboard-v2/.cache:/usr/app/.cache + - ./docker/data/dashboard-v2/public:/usr/app/public + networks: + shared: + ipv4_address: 10.10.10.90 + expose: + - 9000 + depends_on: + - mongo diff --git a/packages/dashboard-v2/Dockerfile b/packages/dashboard-v2/Dockerfile new file mode 100644 index 00000000..70790cfa --- /dev/null +++ b/packages/dashboard-v2/Dockerfile @@ -0,0 +1,14 @@ +FROM node:16.14.2-alpine + +WORKDIR /usr/app + +COPY package.json yarn.lock ./ + +RUN yarn --frozen-lockfile + +COPY static ./static +COPY src ./src +COPY gatsby*.js ./ +COPY postcss.config.js tailwind.config.js ./ + +CMD ["sh", "-c", "yarn build && yarn serve --host 0.0.0.0 -p 9000"] diff --git a/packages/dashboard-v2/gatsby-config.js b/packages/dashboard-v2/gatsby-config.js index c6096a98..2280f99b 100644 --- a/packages/dashboard-v2/gatsby-config.js +++ b/packages/dashboard-v2/gatsby-config.js @@ -18,7 +18,7 @@ module.exports = { resolve: "gatsby-source-filesystem", options: { name: "images", - path: "./src/images/", + path: "./static/images/", }, __key: "images", }, diff --git a/packages/dashboard-v2/src/hooks/useUpgradeRedirect.js b/packages/dashboard-v2/src/hooks/useUpgradeRedirect.js index 5529c152..54efd956 100644 --- a/packages/dashboard-v2/src/hooks/useUpgradeRedirect.js +++ b/packages/dashboard-v2/src/hooks/useUpgradeRedirect.js @@ -17,7 +17,6 @@ export default function useUpgradeRedirect() { if (isDataLoaded) { if (settings.isSubscriptionRequired && !hasPaidSubscription) { - console.log("redirecting", user, settings); navigate("/upgrade"); } else { setVerifyingSubscription(false); diff --git a/packages/dashboard-v2/src/layouts/DashboardLayout.js b/packages/dashboard-v2/src/layouts/DashboardLayout.js index 76af9218..fe4c5385 100644 --- a/packages/dashboard-v2/src/layouts/DashboardLayout.js +++ b/packages/dashboard-v2/src/layouts/DashboardLayout.js @@ -5,7 +5,7 @@ import { SWRConfig } from "swr"; import { authenticatedOnly } from "../lib/swrConfig"; import { PageContainer } from "../components/PageContainer"; -import { NavBar } from "../components/Navbar"; +import { NavBar } from "../components/NavBar"; import { Footer } from "../components/Footer"; import { UserProvider, useUser } from "../contexts/user"; import { FullScreenLoadingIndicator } from "../components/LoadingIndicator"; diff --git a/packages/dashboard-v2/src/layouts/UserSettingsLayout.js b/packages/dashboard-v2/src/layouts/UserSettingsLayout.js index 2ca769bc..d7b9b7d4 100644 --- a/packages/dashboard-v2/src/layouts/UserSettingsLayout.js +++ b/packages/dashboard-v2/src/layouts/UserSettingsLayout.js @@ -6,7 +6,7 @@ import { SWRConfig } from "swr"; import { authenticatedOnly } from "../lib/swrConfig"; import { PageContainer } from "../components/PageContainer"; -import { NavBar } from "../components/Navbar"; +import { NavBar } from "../components/NavBar"; import { Footer } from "../components/Footer"; import { UserProvider, useUser } from "../contexts/user"; import { ContainerLoadingIndicator } from "../components/LoadingIndicator"; diff --git a/packages/dashboard-v2/src/pages/auth/signup.js b/packages/dashboard-v2/src/pages/auth/signup.js index b6f0e0ac..4da915f1 100644 --- a/packages/dashboard-v2/src/pages/auth/signup.js +++ b/packages/dashboard-v2/src/pages/auth/signup.js @@ -15,7 +15,7 @@ const FreePortalHeader = () => { const { plans } = usePlans(); const freePlan = plans.find(({ price }) => price === 0); - const freeStorage = freePlan ? bytes(freePlan.limits?.storageLimit, { binary: true }) : null; + const freeStorage = freePlan?.limits ? bytes(freePlan.limits?.storageLimit, { binary: true }) : null; return (