From c498a100bc1a78c10f00e78617b8d03348f69d01 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Wed, 25 Oct 2023 20:59:45 +0200 Subject: [PATCH] Revert "creates kubernetes friendly deployment" This reverts commit b42153bcc48f60889840e1efc0b842fcd41355eb. --- docker-compose.prod.yml | 9 ++------- docker/mariadb/Dockerfile | 1 - docker/mariadb/my.cnf | 3 +-- docker/migration/Dockerfile | 2 +- docker/migration/start.sh | 4 ++-- packages/server/Dockerfile | 16 +++------------- packages/server/src/config/index.ts | 1 - packages/webapp/Dockerfile | 13 +++---------- packages/webapp/craco.config.js | 5 ----- packages/webapp/nginx/sites/default.conf | 4 ---- 10 files changed, 12 insertions(+), 46 deletions(-) diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 00e5a5e5b..21e9f74c2 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -27,19 +27,14 @@ services: webapp: container_name: bigcapital-webapp - build: - context: ./ - dockerfile: packages/webapp/Dockerfile + image: ghcr.io/bigcapitalhq/webapp:latest deploy: restart_policy: condition: unless-stopped server: container_name: bigcapital-server - # image: ghcr.io/bigcapitalhq/server:latest - build: - context: ./ - dockerfile: packages/server/Dockerfile + image: ghcr.io/bigcapitalhq/server:latest links: - mysql - mongo diff --git a/docker/mariadb/Dockerfile b/docker/mariadb/Dockerfile index 2cce48c78..f7b667668 100644 --- a/docker/mariadb/Dockerfile +++ b/docker/mariadb/Dockerfile @@ -21,7 +21,6 @@ COPY ./docker-entrypoint.sh /docker-entrypoint-initdb.d/docker-initialize.sh # the mysql user inside the MySQL Docker container. RUN chown -R mysql:root /docker-entrypoint-initdb.d RUN chown -R mysql:root /scripts -# RUN chown -R mysql:root /tmp CMD ["mysqld"] EXPOSE 3306 \ No newline at end of file diff --git a/docker/mariadb/my.cnf b/docker/mariadb/my.cnf index 1082ef9f2..ff1b64f79 100644 --- a/docker/mariadb/my.cnf +++ b/docker/mariadb/my.cnf @@ -1,3 +1,2 @@ [mysqld] -bind-address = 0.0.0.0 -innodb_temp_data_file_path = ../../../tmp/ibtmp1:12M:autoextend \ No newline at end of file +bind-address = 0.0.0.0 \ No newline at end of file diff --git a/docker/migration/Dockerfile b/docker/migration/Dockerfile index 7949721c0..162d5039c 100644 --- a/docker/migration/Dockerfile +++ b/docker/migration/Dockerfile @@ -1,4 +1,4 @@ -FROM kochie/bigcapital-server:latest as build +FROM ghcr.io/bigcapitalhq/server:latest as build ARG DB_HOST= \ DB_USER= \ diff --git a/docker/migration/start.sh b/docker/migration/start.sh index 1d5f70fc3..5fa9f0c28 100644 --- a/docker/migration/start.sh +++ b/docker/migration/start.sh @@ -1,5 +1,5 @@ # Migrate the master system database. -./wait-for-it/wait-for-it.sh ${DB_HOST}:3306 -- node ./build/commands.js system:migrate:latest +./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js system:migrate:latest # Migrate all tenants. -./wait-for-it/wait-for-it.sh ${DB_HOST}:3306 -- node ./build/commands.js tenants:migrate:latest \ No newline at end of file +./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js tenants:migrate:latest \ No newline at end of file diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index 4c867a714..af2de4263 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine as build +FROM node:14.20-alpine as build USER root @@ -85,23 +85,13 @@ RUN chown node:node / # Copy application dependency manifests to the container image. COPY ./package*.json ./ -COPY ./pnpm-lock.yaml ./ -COPY ./pnpm-workspace.yaml ./ COPY ./packages/server/package*.json ./packages/server/ -# RUN curl -fsSL https://get.pnpm.io/install.sh | sh - -RUN npm install -g pnpm - COPY ./lerna.json ./lerna.json # Install app dependencies for production. -RUN apk update -RUN apk add python3 build-base chromium - -# Set PYHTON env -ENV PYTHON=/usr/bin/python3 -RUN pnpm install -# RUN npm run bootstrap +RUN npm install +RUN npm run bootstrap COPY --chown=node:node ./packages/server ./packages/server diff --git a/packages/server/src/config/index.ts b/packages/server/src/config/index.ts index 34bc57127..bc6833130 100644 --- a/packages/server/src/config/index.ts +++ b/packages/server/src/config/index.ts @@ -120,7 +120,6 @@ module.exports = { * Redis storage configuration. */ redis: { - url: process.env.REDIS_URL, port: 6379, }, diff --git a/packages/webapp/Dockerfile b/packages/webapp/Dockerfile index 0b55a6ca6..6415a6510 100644 --- a/packages/webapp/Dockerfile +++ b/packages/webapp/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16-alpine as build +FROM node:14.15.0 as build USER root @@ -7,18 +7,11 @@ WORKDIR /app # Install dependencies COPY package*.json ./ COPY lerna.json ./ -COPY pnpm-lock.yaml ./ -COPY pnpm-workspace.yaml ./ COPY ./packages/webapp/package*.json /app/packages/webapp/ -RUN apk update -RUN apk add python3 build-base chromium -ENV PYTHON=/usr/bin/python3 - -RUN npm install -g pnpm -RUN pnpm install -# RUN npm run bootstrap +RUN npm install +RUN npm run bootstrap # Build webapp package COPY ./packages/webapp /app/packages/webapp diff --git a/packages/webapp/craco.config.js b/packages/webapp/craco.config.js index c86d33ebc..724a886c9 100644 --- a/packages/webapp/craco.config.js +++ b/packages/webapp/craco.config.js @@ -5,10 +5,5 @@ module.exports = { alias: { '@': path.resolve(__dirname, 'src'), }, - configure: { - resolve: { - fallback: { path: require.resolve('path-browserify') }, - }, - }, }, }; diff --git a/packages/webapp/nginx/sites/default.conf b/packages/webapp/nginx/sites/default.conf index 2780060ab..58bb77ece 100644 --- a/packages/webapp/nginx/sites/default.conf +++ b/packages/webapp/nginx/sites/default.conf @@ -5,8 +5,4 @@ server { root /usr/share/nginx/html; try_files $uri /index.html; } - - location /api { - proxy_pass http://localhost:3000; - } } \ No newline at end of file