-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
193 additions
and
58 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,91 @@ | ||
version: "3.8" | ||
|
||
services: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: packages/app/Dockerfile | ||
container_name: #{PROJECT_NAME}#_app | ||
restart: unless-stopped | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
ports: | ||
- "3000:3000" | ||
|
||
crons: | ||
build: | ||
context: . | ||
dockerfile: packages/app/crons/Dockerfile | ||
container_name: #{PROJECT_NAME}#_crons | ||
restart: unless-stopped | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
|
||
docs: | ||
build: | ||
context: . | ||
dockerfile: packages/docs/Dockerfile | ||
container_name: #{PROJECT_NAME}#_docs | ||
restart: unless-stopped | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
ports: | ||
- "3001:3000" | ||
#? You can comment the volumes section if you are not using the static files | ||
volumes: | ||
- .:/docs/.docusaurus | ||
|
||
landing: | ||
build: | ||
context: . | ||
dockerfile: packages/landing/Dockerfile | ||
container_name: #{PROJECT_NAME}#_landing | ||
restart: unless-stopped | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
ports: | ||
- "3002:3000" | ||
|
||
db: | ||
image: postgres:latest | ||
container_name: #{PROJECT_NAME}#_db | ||
restart: unless-stopped | ||
volumes: | ||
- #{PROJECT_NAME}#-postgres-data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: ${DATABASE_USER} | ||
POSTGRES_PASSWORD: ${DATABASE_PASS} | ||
POSTGRES_DB: ${DATABASE_NAME} | ||
|
||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
ports: | ||
- "5432:5432" | ||
|
||
redis: | ||
image: redis:latest | ||
restart: unless-stopped | ||
container_name: #{PROJECT_NAME}#_redis | ||
command: /bin/sh -c "redis-server --requirepass ${REDIS_PASSWORD}" | ||
logging: | ||
driver: "json-file" | ||
options: | ||
max-size: "50m" | ||
volumes: | ||
- #{PROJECT_NAME}#-redis-data:/data | ||
ports: | ||
- "6379:6379" | ||
|
||
volumes: | ||
#{PROJECT_NAME}#-postgres-data: | ||
#{PROJECT_NAME}#-redis-data: |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,23 +1,46 @@ | ||
FROM node:20-alpine | ||
FROM node:20-alpine AS deps | ||
|
||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
ENV NODE_ENV production | ||
|
||
#? Copy the necessary files to install dependencies | ||
COPY package*.json . | ||
COPY packages/lib/package*.json ./packages/lib/ | ||
COPY packages/app/package*.json ./packages/app/ | ||
COPY packages/app/prisma/schema.prisma ./packages/app/prisma/schema.prisma | ||
|
||
RUN npm i --only=production | ||
|
||
|
||
FROM node:20-alpine AS builder | ||
|
||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
ENV PORT 3000 | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
ENV NODE_ENV production | ||
|
||
COPY package.json . | ||
COPY package-lock.json . | ||
COPY prisma/schema.prisma ./prisma/schema.prisma | ||
COPY --from=deps /usr/src/app . | ||
|
||
RUN npm i --only=production | ||
COPY packages/lib ./packages/lib | ||
COPY packages/app ./packages/app | ||
|
||
RUN npm run build -w packages/app | ||
|
||
|
||
FROM node:20-alpine AS runner | ||
|
||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
COPY . . | ||
ENV PORT 3000 | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
ENV NODE_ENV production | ||
|
||
RUN npm run build | ||
COPY --from=builder /usr/src/app . | ||
|
||
EXPOSE 3000 | ||
|
||
CMD [ "npm", "start" ] | ||
CMD [ "npm", "start", "-w", "packages/app" ] |
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,19 +1,28 @@ | ||
FROM node:20-alpine | ||
FROM node:20-alpine AS deps | ||
|
||
RUN mkdir -p /usr/src/app | ||
|
||
WORKDIR /usr/src/app | ||
|
||
ENV PORT 3000 | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
ENV NODE_ENV production | ||
|
||
COPY package.json . | ||
COPY package-lock.json . | ||
COPY prisma/schema.prisma ./prisma/schema.prisma | ||
#? Copy the necessary files to install dependencies | ||
COPY package*.json . | ||
COPY packages/lib/package*.json ./packages/lib/ | ||
COPY packages/app/package*.json ./packages/app/ | ||
COPY packages/app/prisma/schema.prisma ./packages/app/prisma/schema.prisma | ||
|
||
RUN npm i --only=production | ||
|
||
COPY . . | ||
|
||
CMD [ "npm", "run", "cron" ] | ||
FROM node:20-alpine AS runner | ||
|
||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
COPY --from=deps /usr/src/app . | ||
|
||
COPY packages/lib ./packages/lib | ||
COPY packages/app ./packages/app | ||
|
||
|
||
CMD [ "npm", "run", "cron", "-w", "packages/app" ] |
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
Oops, something went wrong.