Skip to content

Commit

Permalink
build : docker-compose 사용 시 redis 이미지를 같이 build
Browse files Browse the repository at this point in the history
DESC
----
- docker-compose 사용 시 redis 이미지를 같이 build
  • Loading branch information
Themion committed Sep 17, 2023
1 parent c5f7565 commit 8ff0bf1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
19 changes: 19 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ services:
expose:
- ${POSTGRES_PORT}

cache:
build:
dockerfile: packages/cache/Dockerfile
context: .
args:
REDIS_USER: ${REDIS_USER}
REDIS_PASS: ${REDIS_PASS}
REDIS_PORT: ${REDIS_PORT}
restart: always
networks:
- app
env_file:
- .env
ports:
- ${REDIS_PORT}:6379
expose:
- ${REDIS_PORT}

backend:
build:
dockerfile: packages/backend/Dockerfile
Expand All @@ -34,6 +52,7 @@ services:
- ${BE_PORT}
depends_on:
- database
- cache

frontend:
build:
Expand Down
2 changes: 2 additions & 0 deletions packages/database/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
docker build . -t database
2 changes: 1 addition & 1 deletion packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"build": "docker build . -t database",
"build": "./build.sh",
"start": "./start.sh"
}
}

0 comments on commit 8ff0bf1

Please sign in to comment.