Skip to content

Commit 39b5d55

Browse files
committed
set config for database
1 parent f906345 commit 39b5d55

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ VITE_IS_DEMO="false"
1919
# DATABASE
2020
DATABASE_URL="postgres://${DOCKER_DATABASE_USERNAME}:${DOCKER_DATABASE_PASSWORD}@localhost:${DOCKER_DATABASE_PORT}/${DOCKER_DATABASE_NAME}"
2121

22+
# for docker build use:
23+
# DATABASE_URL="postgres://${DOCKER_DATABASE_USERNAME}:${DOCKER_DATABASE_PASSWORD}start-ui-web-postgres-1/${DOCKER_DATABASE_NAME}"
24+
2225
# AUTH
2326
AUTH_SECRET="REPLACE ME" # You can use `npx @better-auth/cli@latest secret` to a generated secret
2427
AUTH_SESSION_EXPIRATION_IN_SECONDS=2592000 # 30 days

Dockerfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ COPY package.json pnpm-lock.yaml ./
1717
COPY run-jiti.js ./
1818
COPY src/features/build-info/script-to-generate-json.ts src/features/build-info/build-info.gen.json ./src/features/build-info/
1919
COPY prisma/schema.prisma ./prisma/
20+
2021
RUN pnpm install --frozen-lockfile
2122

2223
# copy source
2324
COPY . .
2425

25-
# build .output
2626
ENV NODE_OPTIONS=--max-old-space-size=4096
27+
28+
# build app
2729
RUN pnpm build
2830

2931

@@ -33,6 +35,11 @@ FROM node:22-alpine AS runtime
3335

3436
WORKDIR /app
3537

38+
# ENV
39+
ENV NODE_ENV=production
40+
ENV HOST=0.0.0.0
41+
ENV PORT=3000
42+
3643
# install pnpm
3744
RUN npm install -g pnpm npm-run-all
3845

@@ -46,11 +53,6 @@ COPY --from=builder /app/package.json ./package.json
4653
COPY --from=builder /app/pnpm-lock.yaml ./pnpm-lock.yaml
4754
COPY --from=builder /app/node_modules ./node_modules
4855

49-
ENV NODE_ENV=production
50-
51-
ENV HOST=0.0.0.0
52-
ENV PORT=3000
53-
5456
EXPOSE 3000
5557

5658
# start

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"dk:start": "docker compose start",
3737
"dk:stop": "docker compose stop",
3838
"dk:clear": "docker compose down --volumes",
39+
"dk:build": "docker build -t start-ui-web . && docker run -d --network start-ui-web_default -p 3000:3000 --name start-ui-web-container start-ui-web",
3940
"db:init": "pnpm db:push && pnpm db:seed",
4041
"db:push": "prisma db push",
4142
"db:ui": "prisma studio",

0 commit comments

Comments
 (0)