-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(notes): modified docker file and port
- Loading branch information
1 parent
8abb02a
commit dbe704c
Showing
13 changed files
with
171 additions
and
94 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.vscode | ||
**/*_password.txt | ||
.DS_Store | ||
node_modules | ||
node_modules |
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,91 +1,118 @@ | ||
version: "3.8" | ||
|
||
secrets: | ||
kong_db_password: | ||
file: ./kong_db_password.txt | ||
# secrets: | ||
# kong_db_password: | ||
# file: ./kong_db_password.txt | ||
|
||
x-common-env: | ||
&common-env | ||
KONG_PG_HOST: kong-database | ||
KONG_PG_USER: kong | ||
KONG_PG_PASSWORD_FILE: /run/secrets/kong_db_password | ||
# x-common-env: | ||
# &common-env | ||
# KONG_PG_HOST: kong-database | ||
# KONG_PG_USER: kong | ||
# KONG_PG_PASSWORD_FILE: /run/secrets/kong_db_password | ||
|
||
networks: | ||
default: | ||
|
||
volumes: | ||
kong-data: {} | ||
user-storage-db-volume: {} | ||
# kong-data: {} | ||
# user-storage-db-volume: {} | ||
notes-db-volume: {} | ||
|
||
services: | ||
kong-gateway: | ||
image: kong:latest | ||
build: ../../kong-gateway | ||
environment: | ||
<<: *common-env | ||
KONG_DATABASE: off | ||
KONG_PLUGINS: bundled,authn-kong | ||
KONG_DECLARATIVE_CONFIG: /etc/kong/kong.yml | ||
ports: | ||
- "8000:8000" # Proxy | ||
# - "8001:8001" # Admin API | ||
- "8443:8443" # Proxy SSL | ||
- "8444:8444" # Admin API SSL | ||
healthcheck: | ||
test: ["CMD", "kong", "health"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
secrets: | ||
- kong_db_password | ||
restart: on-failure | ||
volumes: | ||
- ../../kong-gateway/kong.yml:/etc/kong/kong.yml | ||
- ../../kong-gateway/authn-kong:/usr/local/share/lua/5.1/kong/plugins/authn-kong | ||
- ../../kong-gateway/protos:/usr/local/share/lua/5.1/kong/protos | ||
# kong-gateway: | ||
# image: kong:latest | ||
# build: ../../kong-gateway | ||
# environment: | ||
# <<: *common-env | ||
# KONG_DATABASE: off | ||
# KONG_PLUGINS: bundled,authn-kong | ||
# KONG_DECLARATIVE_CONFIG: /etc/kong/kong.yml | ||
# ports: | ||
# - "8000:8000" # Proxy | ||
# # - "8001:8001" # Admin API | ||
# - "8443:8443" # Proxy SSL | ||
# - "8444:8444" # Admin API SSL | ||
# healthcheck: | ||
# test: ["CMD", "kong", "health"] | ||
# interval: 10s | ||
# timeout: 5s | ||
# retries: 5 | ||
# secrets: | ||
# - kong_db_password | ||
# restart: on-failure | ||
# volumes: | ||
# - ../../kong-gateway/kong.yml:/etc/kong/kong.yml | ||
# - ../../kong-gateway/authn-kong:/usr/local/share/lua/5.1/kong/plugins/authn-kong | ||
# - ../../kong-gateway/protos:/usr/local/share/lua/5.1/kong/protos | ||
|
||
user-storage-db: | ||
image: postgres | ||
volumes: | ||
- user-storage-db-volume:/var/lib/postgresql/data | ||
- ../sql_table/create_user_storage_table.sql:/docker-entrypoint-initdb.d/user_storage.sql | ||
# user-storage-db: | ||
# image: postgres | ||
# volumes: | ||
# - user-storage-db-volume:/var/lib/postgresql/data | ||
# - ../sql_table/create_user_storage_table.sql:/docker-entrypoint-initdb.d/user_storage.sql | ||
# environment: | ||
# POSTGRES_DB: user_storage_db | ||
# POSTGRES_USER: user_storage_user | ||
# POSTGRES_PASSWORD: user_storage_password | ||
# ports: | ||
# - "5432:5432" | ||
# healthcheck: | ||
# test: ["CMD-SHELL", "pg_isready -U user_storage_user -d user_storage_db"] | ||
# interval: 10s | ||
# timeout: 5s | ||
# retries: 5 | ||
|
||
notes-db: | ||
image: mysql:latest | ||
environment: | ||
POSTGRES_DB: user_storage_db | ||
POSTGRES_USER: user_storage_user | ||
POSTGRES_PASSWORD: user_storage_password | ||
- MYSQL_ROOT_PASSWORD=root | ||
- MYSQL_DATABASE=my_notes_app | ||
ports: | ||
- "5432:5432" | ||
- "3306:3306" | ||
volumes: | ||
- notes-db-volume:/var/lib/mysql | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U user_storage_user -d user_storage_db"] | ||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
user-redis: | ||
image: redis:7.2-rc2-alpine3.18 | ||
command: redis-server --requirepass password | ||
healthcheck: | ||
test: [ "CMD", "redis-cli", "-a", "password", "--raw", "incr", "ping" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
# user-redis: | ||
# image: redis:7.2-rc2-alpine3.18 | ||
# command: redis-server --requirepass password | ||
# healthcheck: | ||
# test: [ "CMD", "redis-cli", "-a", "password", "--raw", "incr", "ping" ] | ||
# interval: 5s | ||
# timeout: 5s | ||
# retries: 5 | ||
|
||
user-storage-service: | ||
build: ../../user-storage | ||
image: user-storage-service:1.0 | ||
notes-service: | ||
build: ../../notes | ||
depends_on: | ||
kong-gateway: | ||
condition: service_healthy | ||
user-storage-db: | ||
# kong-gateway: | ||
# condition: service_healthy | ||
notes-db: | ||
condition: service_healthy | ||
ports: | ||
- "50051:50051" | ||
- "50052:50052" | ||
|
||
|
||
frontend-client: | ||
build: ../../client | ||
image: client:1.0 | ||
depends_on: | ||
kong-gateway: | ||
condition: service_healthy | ||
ports: | ||
- "3001:3001" | ||
# user-storage-service: | ||
# build: ../../user-storage | ||
# image: user-storage-service:1.0 | ||
# depends_on: | ||
# kong-gateway: | ||
# condition: service_healthy | ||
# user-storage-db: | ||
# condition: service_healthy | ||
# ports: | ||
# - "50051:50051" | ||
|
||
# frontend-client: | ||
# build: ../../client | ||
# image: client:1.0 | ||
# depends_on: | ||
# kong-gateway: | ||
# condition: service_healthy | ||
# ports: | ||
# - "3001:3001" |
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,9 @@ | ||
.vscode | ||
**/*_password.txt | ||
.DS_Store | ||
node_modules | ||
|
||
.env | ||
.env.local | ||
.env.development.local | ||
|
||
venv | ||
__pycache__ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
grpcio | ||
grpcio-tools | ||
boto3 | ||
mysql-connector-python | ||
mysql-connector-python | ||
python-dotenv |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,48 @@ | ||
FROM node:slim | ||
RUN apt update && apt install curl -y | ||
# FROM node:slim | ||
# RUN apt update && apt install curl -y | ||
|
||
ENV NODE_ENV=development | ||
# ENV NODE_ENV=development | ||
|
||
WORKDIR /app | ||
# WORKDIR /app | ||
|
||
COPY package*.json ./ | ||
# COPY package*.json ./ | ||
|
||
# RUN npm install | ||
|
||
# COPY . . | ||
|
||
# EXPOSE 50051 | ||
|
||
RUN npm install | ||
# CMD [ "npm", "run", "start" ] | ||
|
||
FROM node:20.11.1-alpine3.19 AS build | ||
WORKDIR /app | ||
COPY package*.json ./ | ||
# --only allows the following: null, prod, and production | ||
RUN npm ci | ||
COPY . . | ||
RUN npm run build | ||
COPY protos ./dist/protos | ||
|
||
FROM node:20.11.1-alpine3.19 | ||
ENV NODE_ENV production | ||
WORKDIR /app | ||
COPY .env .env | ||
COPY --from=build /app/dist ./dist | ||
COPY --from=build /app/node_modules ./node_modules | ||
CMD ["node", "./dist/src/index.js"] | ||
|
||
EXPOSE 50051 | ||
# FROM node:20.11.1-alpine3.19 AS build | ||
# WORKDIR /app | ||
# COPY package*.json ./ | ||
# RUN npm ci | ||
# COPY . . | ||
# RUN npm run build | ||
# COPY protos ./dist/protos | ||
|
||
CMD [ "npm", "run", "start" ] | ||
# FROM node:20.11.1-alpine3.19 | ||
# ENV NODE_ENV development | ||
# WORKDIR /app | ||
# COPY --from=build /app/dist ./dist | ||
# COPY --from=build /app/node_modules ./node_modules | ||
# CMD ["node", "./dist/src/index.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
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
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