Skip to content

Commit

Permalink
Release version v0.3.2 (#923)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: nichenqin <nichenqin@hotmail.com>
Co-authored-by: GitHub actions <noreply@github.com>
  • Loading branch information
4 people committed May 5, 2023
1 parent 1b80912 commit 2b69803
Show file tree
Hide file tree
Showing 15 changed files with 116 additions and 93 deletions.
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ RUN npm install -g turbo
COPY . .
RUN turbo prune --scope=@undb/backend --scope=@undb/frontend

ADD https://github.com/benbjohnson/litestream/releases/download/v0.3.9/litestream-v0.3.9-linux-amd64-static.tar.gz /tmp/litestream.tar.gz
RUN tar -C /usr/local/bin -xzf /tmp/litestream.tar.gz

# installer
FROM node:18-bullseye AS installer
FROM node:18-bullseye-slim AS installer

RUN npm install -g pnpm

Expand All @@ -32,16 +35,24 @@ RUN rm -rf ./node_modules
RUN HUSKY=0 pnpm install -r --prod

# runner
FROM gcr.io/distroless/nodejs18-debian11 as runner
FROM node:18-bullseye-slim as runner

WORKDIR /undb

EXPOSE 4000

ENV NODE_ENV production
ENV UNDB_DATABASE_SQLITE_DATA /var/opt/.undb

RUN npm install -g zx

COPY --from=installer /undb/node_modules ./node_modules
COPY --from=installer /undb/packages ./packages
COPY --from=installer /undb/apps/backend ./apps/backend
COPY --from=installer /undb/apps/frontend/build ./out
COPY --from=builder /usr/local/bin/litestream /usr/local/bin/litestream
COPY scripts/start.mjs ./scripts/start.mjs

COPY litestream/etc/litestream.yml /etc/litestream.yml

CMD ["apps/backend/dist/main.js"]
CMD ["scripts/start.mjs"]
2 changes: 1 addition & 1 deletion apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"type-fest": "^3.9.0",
"typescript": "^5.0.4",
"vite": "^4.3.3",
"vitest": "^0.30.1",
"vitest": "^0.31.0",
"zod": "^3.21.4"
},
"type": "module"
Expand Down
23 changes: 23 additions & 0 deletions docker/docker-compose.minio.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: "3.0"
services:
undb:
image: ghcr.io/undb-xyz/undb:latest
platform: linux/x86_64
container_name: undb
volumes:
- ~/.undb/:/var/opt/undb
ports:
- 4000:4000
minio:
image: minio/minio:latest
platform: linux/x86_64
container_name: minio
command: server /data --console-address ":9001"
environment:
- UNDB_LITESTREAM_REPLICA_URL=s3://undb.localhost:9000/undb.db
- LITESTREAM_ACCESS_KEY_ID=minioadmin
- LITESTREAM_SECRET_ACCESS_KEY=minioadmin

ports:
- 9000:9000
- 9001:9001
4 changes: 4 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ mounts = []
primary_region = "lax"
processes = []

[build]
image = "ghcr.io/undb-xyz/undb:latest"

[[services]]
internal_port = 4000
processes = ["app"]
Expand All @@ -28,3 +31,4 @@ processes = []
[env]
PUBLIC_UNDB_ADMIN_EMAIL = "test@example.com"
PUBLIC_UNDB_ADMIN_PASSWORD = "123456"
UNDB_LITESTREAM_REPLICA_URL = "s3://undb/undb.db"
4 changes: 4 additions & 0 deletions litestream/etc/litestream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dbs:
- path: /var/opt/.undb/undb.db
replicas:
- url: ${UNDB_LITESTREAM_REPLICA_URL}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "undb",
"version": "0.3.1",
"version": "0.3.2",
"devDependencies": {
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.6.1",
Expand Down Expand Up @@ -33,8 +33,7 @@
"db:schema:fresh": "turbo run db:schema:fresh",
"dev": "FORCE_COLOR=1 dotenv -- turbo run dev --parallel --concurrency=12",
"dev:packages": "FORCE_COLOR=1 turbo run dev --parallel --filter=./packages/*",
"docker:down": "docker compose -f ./docker/docker-compose.yaml down",
"docker:up": "docker compose -f ./docker/docker-compose.yaml up -d",
"docker:minio": "docker compose -f ./docker/docker-compose.minio.yaml up -d",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"lint": "turbo run lint",
"preinstall": "npx only-allow pnpm",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"tsup": "^6.7.0",
"type-fest": "^3.9.0",
"typescript": "^5.0.4",
"vitest": "^0.30.1",
"vitest": "^0.31.0",
"vitest-mock-extended": "^1.1.3"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/cqrs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"tsconfig": "^0.0.0",
"tsup": "^6.7.0",
"typescript": "^5.0.4",
"vitest": "^0.30.1"
"vitest": "^0.31.0"
},
"exports": {
"import": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/database/sqlite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"tsup": "^6.7.0",
"type-fest": "^3.9.0",
"typescript": "^5.0.4",
"vitest": "^0.30.1",
"vitest": "^0.31.0",
"vitest-mock-extended": "^1.1.3"
},
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion packages/database/sqlite/src/create-mikro-orm-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const createConfig = (data: string, env = 'development') =>
highlighter: new SqlHighlighter(),
metadataProvider: ReflectMetadataProvider,
driver: BetterSqliteDriver,
dbName: path.join(data, `undb.${env}.sqlite`),
dbName: path.join(data, `undb.db`),
debug: env !== 'production',
forceUndefined: true,
flushMode: FlushMode.ALWAYS,
Expand Down
2 changes: 1 addition & 1 deletion packages/domain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"tsconfig": "^0.0.0",
"tsup": "^6.7.0",
"typescript": "^5.0.4",
"vitest": "^0.30.1"
"vitest": "^0.31.0"
},
"exports": {
"import": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"tsconfig": "^0.0.0",
"tsup": "^6.7.0",
"typescript": "^5.0.4",
"vitest": "^0.30.1"
"vitest": "^0.31.0"
},
"exports": {
"import": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/trpc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"tsconfig": "^0.0.0",
"tsup": "^6.7.0",
"typescript": "^5.0.4",
"vitest": "^0.30.1"
"vitest": "^0.31.0"
},
"exports": {
"import": "./dist/index.js",
Expand Down
Loading

0 comments on commit 2b69803

Please sign in to comment.