-
Notifications
You must be signed in to change notification settings - Fork 3
Added Dockerfiles #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| FROM node:20-alpine | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| RUN corepack enable && corepack prepare pnpm@latest --activate | ||
|
|
||
| COPY package.json pnpm-lock.yaml ./ | ||
|
|
||
| RUN pnpm install | ||
|
|
||
| COPY . . | ||
|
|
||
| CMD ["pnpm", "start:dev"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| version: "3.9" | ||
|
|
||
| services: | ||
| app: | ||
| image: postgres:13 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. postgres 13? that's way too old bro, and also we need to use the alpine version for both postgres and redis. |
||
| container_name: multi_tenant_db | ||
| environment: | ||
| POSTGRES_USER: user | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think also here we could make use of env variables? |
||
| POSTGRES_PASSWORD: postgres8090 | ||
| POSTGRES_DB: Multi-Tenant | ||
| ports: | ||
| - "5432:5432" | ||
| networks: | ||
| - backend | ||
| volumes: | ||
| - app_data:/var/lib/postgresql/data | ||
| restart: unless-stopped | ||
|
|
||
| cache: | ||
| image: redis:6 | ||
| container_name: redis_cache | ||
| ports: | ||
| - "6379:6379" | ||
| networks: | ||
| - backend | ||
| volumes: | ||
| - cache_data:/data | ||
| restart: unless-stopped | ||
|
|
||
| api: | ||
| container_name: multi_tenant_api | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| command: pnpm run start:dev | ||
| ports: | ||
| - "3000:3000" | ||
| volumes: | ||
| - .:/app | ||
| - /app/node_modules | ||
| environment: | ||
| DATABASE_HOST: app | ||
| DATABASE_PORT: 5432 | ||
| DATABASE_USER: user | ||
| DATABASE_PASSWORD: postgres8090 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same here for env variables |
||
| DATABASE_NAME: Multi-Tenant | ||
| REDIS_HOST: cache | ||
| REDIS_PORT: 6379 | ||
| depends_on: | ||
| - app | ||
| - cache | ||
| networks: | ||
| - backend | ||
| restart: unless-stopped | ||
|
|
||
| networks: | ||
| backend: | ||
| driver: bridge | ||
|
|
||
| volumes: | ||
| app_data: | ||
| cache_data: | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think docker-compose now doesn't need this line, but it's ok