Skip to content

Commit eeb32a8

Browse files
chore : Fix Docker Compose & Dockerfile
1 parent eb24ab0 commit eeb32a8

File tree

5 files changed

+129
-138
lines changed

5 files changed

+129
-138
lines changed

client/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@ RUN npm run build
1717
# Production runner - minimal Node.js runtime
1818
FROM node:20-alpine AS runner
1919

20-
ENV NODE_ENV=production \
21-
HOST=0.0.0.0 \
22-
PORT=3000
20+
# Environment variables will be provided via docker-compose
21+
ARG NODE_ENV=production
22+
ARG HOST=0.0.0.0
23+
ARG PORT=3000
24+
25+
ENV NODE_ENV=${NODE_ENV} \
26+
HOST=${HOST} \
27+
PORT=${PORT}
2328

2429
WORKDIR /app
2530

client/package-lock.json

Lines changed: 92 additions & 125 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7+
"start": "nuxt start",
78
"build": "nuxt build",
89
"dev": "nuxt dev",
910
"generate": "nuxt generate",
1011
"preview": "nuxt preview",
1112
"postinstall": "nuxt prepare"
1213
},
1314
"dependencies": {
14-
"apexcharts": "^3.50.0",
15+
"apexcharts": "^4.0.0",
1516
"dompurify": "^3.3.0",
1617
"drizzle-orm": "^0.44.7",
1718
"marked": "^16.4.1",

docker-compose.yml

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,46 @@ services:
2525
# build:
2626
# context: ./client
2727
# dockerfile: Dockerfile
28+
# args:
29+
# NODE_ENV: ${NODE_ENV:-production}
30+
# HOST: ${HOST:-0.0.0.0}
31+
# PORT: ${CLIENT_PORT:-3000}
2832
# container_name: ai-trading-bot-client
2933
# restart: unless-stopped
34+
# env_file:
35+
# - client/.env
3036
# ports:
3137
# - "${CLIENT_PORT:-3000}:3000"
3238
# environment:
33-
# NODE_ENV: production
34-
# HOST: 0.0.0.0
39+
# # NUXT_POSTGRES_USER: ${POSTGRES_USER:-postgres}
40+
# # NUXT_POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
41+
# # NUXT_POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
42+
# # NUXT_POSTGRES_PORT: ${POSTGRES_PORT:-5432}
43+
# # NUXT_POSTGRES_DB: ${POSTGRES_DB:-trading_bot}
44+
# # NUXT_DB_CONNECTION_STRING: ${DB_CONNECTION_STRING:-}
45+
# # NUXT_NODE_ENV: ${NODE_ENV:-production}
3546
# PORT: 3000
47+
# depends_on:
48+
# postgres:
49+
# condition: service_healthy
3650
# networks:
3751
# - trading-bot-network
3852

3953
# server:
4054
# build:
4155
# context: ./server
4256
# dockerfile: Dockerfile
57+
# args:
58+
# NODE_ENV: ${NODE_ENV:-production}
4359
# container_name: ai-trading-bot-server
4460
# restart: unless-stopped
45-
# ports:
46-
# - "${SERVER_PORT:-3000}:3000"
4761
# env_file:
48-
# - ./server/.env
49-
# environment:
50-
# DATABASE_URL: postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:5432/${POSTGRES_DB:-trading_bot}
51-
# POSTGRES_HOST: postgres
62+
# - server/.env
63+
# ports:
64+
# - "${SERVER_PORT:-3001}:3000"
65+
# # environment:
66+
# # # Computed value - build connection string if DB_CONNECTION_STRING not provided
67+
# # DATABASE_URL: ${DB_CONNECTION_STRING:-postgresql://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@postgres:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-trading_bot}}
5268
# depends_on:
5369
# postgres:
5470
# condition: service_healthy

server/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ RUN bun run build
2020
FROM base AS runner
2121
WORKDIR /app
2222

23-
ENV NODE_ENV=production
23+
# Environment variables will be provided via docker-compose
24+
ARG NODE_ENV=production
25+
ENV NODE_ENV=${NODE_ENV}
2426

2527
# Copy package files and install only production dependencies
2628
COPY package.json bun.lockb ./

0 commit comments

Comments
 (0)