-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add Dockerfile & docker-compose for local dev
- Loading branch information
1 parent
fbe503e
commit f641bf1
Showing
7 changed files
with
62 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Build stage | ||
FROM node:20.15.0-alpine as builder | ||
WORKDIR /app | ||
COPY ["package.json", "package-lock.json", "./"] | ||
COPY ["tsconfig.json", "tsconfig.build.json", "./"] | ||
COPY config ./config | ||
COPY src ./src | ||
RUN npm install &&\ | ||
npm run build | ||
|
||
# Development stage | ||
FROM node:20.15.0-alpine as development | ||
ENV NODE_ENV=production | ||
WORKDIR /app | ||
COPY --from=builder /app/config ./config | ||
COPY --from=builder /app/dist ./dist | ||
COPY --from=builder /app/package*.json ./ | ||
RUN npm install --only=production | ||
CMD node ./dist/main.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"API_REDIS_HOST": "localhost", | ||
"API_REDIS_PORT": 6379 | ||
"REDIS_HOST": "localhost", | ||
"REDIS_PORT": 6379 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"REDIS_HOST": "hero-cache", | ||
"REDIS_PORT": 6379 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"API_REDIS_HOST": "localhost", | ||
"API_REDIS_PORT": 6379 | ||
"REDIS_HOST": "localhost", | ||
"REDIS_PORT": 6379 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: '3.8' | ||
services: | ||
app: | ||
build: . | ||
image: hero-app | ||
container_name: hero-app | ||
environment: | ||
- NODE_ENV=docker | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- redis | ||
redis: | ||
image: redis:7.2.5-alpine | ||
container_name: hero-cache | ||
ports: | ||
- 6379:6379 | ||
vault: | ||
image: vault:1.13.3 | ||
container_name: hero-vault | ||
volumes: | ||
- ./config:/vault/config | ||
ports: | ||
- 8200:8200 | ||
cap_add: | ||
- IPC_LOCK | ||
environment: | ||
- VAULT_ADDR=http://localhost:8200 | ||
- VAULT_TOKEN=myroot | ||
command: server -config=/vault/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters