mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
creates kubernetes friendly deployment
This commit is contained in:
@@ -27,14 +27,19 @@ services:
|
|||||||
|
|
||||||
webapp:
|
webapp:
|
||||||
container_name: bigcapital-webapp
|
container_name: bigcapital-webapp
|
||||||
image: ghcr.io/bigcapitalhq/webapp:latest
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: packages/webapp/Dockerfile
|
||||||
deploy:
|
deploy:
|
||||||
restart_policy:
|
restart_policy:
|
||||||
condition: unless-stopped
|
condition: unless-stopped
|
||||||
|
|
||||||
server:
|
server:
|
||||||
container_name: bigcapital-server
|
container_name: bigcapital-server
|
||||||
image: ghcr.io/bigcapitalhq/server:latest
|
# image: ghcr.io/bigcapitalhq/server:latest
|
||||||
|
build:
|
||||||
|
context: ./
|
||||||
|
dockerfile: packages/server/Dockerfile
|
||||||
links:
|
links:
|
||||||
- mysql
|
- mysql
|
||||||
- mongo
|
- mongo
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ COPY ./docker-entrypoint.sh /docker-entrypoint-initdb.d/docker-initialize.sh
|
|||||||
# the mysql user inside the MySQL Docker container.
|
# the mysql user inside the MySQL Docker container.
|
||||||
RUN chown -R mysql:root /docker-entrypoint-initdb.d
|
RUN chown -R mysql:root /docker-entrypoint-initdb.d
|
||||||
RUN chown -R mysql:root /scripts
|
RUN chown -R mysql:root /scripts
|
||||||
|
# RUN chown -R mysql:root /tmp
|
||||||
|
|
||||||
CMD ["mysqld"]
|
CMD ["mysqld"]
|
||||||
EXPOSE 3306
|
EXPOSE 3306
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
[mysqld]
|
[mysqld]
|
||||||
bind-address = 0.0.0.0
|
bind-address = 0.0.0.0
|
||||||
|
innodb_temp_data_file_path = ../../../tmp/ibtmp1:12M:autoextend
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM ghcr.io/bigcapitalhq/server:latest as build
|
FROM kochie/bigcapital-server:latest as build
|
||||||
|
|
||||||
ARG DB_HOST= \
|
ARG DB_HOST= \
|
||||||
DB_USER= \
|
DB_USER= \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Migrate the master system database.
|
# Migrate the master system database.
|
||||||
./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js system:migrate:latest
|
./wait-for-it/wait-for-it.sh ${DB_HOST}:3306 -- node ./build/commands.js system:migrate:latest
|
||||||
|
|
||||||
# Migrate all tenants.
|
# Migrate all tenants.
|
||||||
./wait-for-it/wait-for-it.sh mysql:3306 -- node ./build/commands.js tenants:migrate:latest
|
./wait-for-it/wait-for-it.sh ${DB_HOST}:3306 -- node ./build/commands.js tenants:migrate:latest
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:14.20-alpine as build
|
FROM node:16-alpine as build
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
@@ -85,13 +85,23 @@ RUN chown node:node /
|
|||||||
|
|
||||||
# Copy application dependency manifests to the container image.
|
# Copy application dependency manifests to the container image.
|
||||||
COPY ./package*.json ./
|
COPY ./package*.json ./
|
||||||
|
COPY ./pnpm-lock.yaml ./
|
||||||
|
COPY ./pnpm-workspace.yaml ./
|
||||||
COPY ./packages/server/package*.json ./packages/server/
|
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
|
COPY ./lerna.json ./lerna.json
|
||||||
|
|
||||||
# Install app dependencies for production.
|
# Install app dependencies for production.
|
||||||
RUN npm install
|
RUN apk update
|
||||||
RUN npm run bootstrap
|
RUN apk add python3 build-base chromium
|
||||||
|
|
||||||
|
# Set PYHTON env
|
||||||
|
ENV PYTHON=/usr/bin/python3
|
||||||
|
RUN pnpm install
|
||||||
|
# RUN npm run bootstrap
|
||||||
|
|
||||||
COPY --chown=node:node ./packages/server ./packages/server
|
COPY --chown=node:node ./packages/server ./packages/server
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ module.exports = {
|
|||||||
* Redis storage configuration.
|
* Redis storage configuration.
|
||||||
*/
|
*/
|
||||||
redis: {
|
redis: {
|
||||||
|
url: process.env.REDIS_URL,
|
||||||
port: 6379,
|
port: 6379,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:14.15.0 as build
|
FROM node:16-alpine as build
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
@@ -7,11 +7,18 @@ WORKDIR /app
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
COPY lerna.json ./
|
COPY lerna.json ./
|
||||||
|
COPY pnpm-lock.yaml ./
|
||||||
|
COPY pnpm-workspace.yaml ./
|
||||||
|
|
||||||
COPY ./packages/webapp/package*.json /app/packages/webapp/
|
COPY ./packages/webapp/package*.json /app/packages/webapp/
|
||||||
|
|
||||||
RUN npm install
|
RUN apk update
|
||||||
RUN npm run bootstrap
|
RUN apk add python3 build-base chromium
|
||||||
|
ENV PYTHON=/usr/bin/python3
|
||||||
|
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
RUN pnpm install
|
||||||
|
# RUN npm run bootstrap
|
||||||
|
|
||||||
# Build webapp package
|
# Build webapp package
|
||||||
COPY ./packages/webapp /app/packages/webapp
|
COPY ./packages/webapp /app/packages/webapp
|
||||||
|
|||||||
@@ -5,5 +5,10 @@ module.exports = {
|
|||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, 'src'),
|
'@': path.resolve(__dirname, 'src'),
|
||||||
},
|
},
|
||||||
|
configure: {
|
||||||
|
resolve: {
|
||||||
|
fallback: { path: require.resolve('path-browserify') },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,4 +5,8 @@ server {
|
|||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
try_files $uri /index.html;
|
try_files $uri /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /api {
|
||||||
|
proxy_pass http://localhost:3000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user