Skip to content

Commit

Permalink
chore: 🤖 Complete dockerfile
Browse files Browse the repository at this point in the history
Now use `docker compose up -d` to start an container, but you need to
start tbd-backend  first

BREAKING CHANGE: 🧨 #1549Closes: #1549
  • Loading branch information
TinyMurky committed Mar 8, 2024
1 parent 5c8ac53 commit bc0ae18
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
FROM node:18-alpine AS base

# 定義一個建構階段的參數 API_URL
ARG API_URL

# 將建構階段的參數設置為環境變數,以便在應用運行時使用
ENV API_URL=${API_URL}

# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

TideBit Decentralize Finance Version

## Docker
1. 請務必先下載 [tbd-backend develop branch](https://github.com/CAFECA-IO/tbd-backend/tree/develop)
2. 先在`tbd-backend`執行, 等待以下指令完成,建立起nest 與 mongoDB兩個container
```
docker compose up -d
```
3. 再回到這個專案底下,使用以下指令啟動tideBit-Defi 指令
```
docker compose up -d
```
## Mockup
- [Mobile](https://xd.adobe.com/view/b4bc1f81-78f4-4de9-979f-20cb0d457d70-e1ef/)
- [Desktop](https://xd.adobe.com/view/920d36bd-2d1a-4edd-8a2a-824445f1d3b0-c75e/?fullscreen&hints=off)

5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ services:
build:
context: ./
dockerfile: Dockerfile
# 確保在build階段也可以有
args:
- API_URL=http://localhost:3001
ports:
- '3000:3000'
environment:
- API_URL=http://nestjs-app:3001
- API_URL=http://localhost:3001
# depends_on:
# - nestjs-app
networks:
Expand Down

0 comments on commit bc0ae18

Please sign in to comment.