-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from brendantwh/final
Synced timers, date sort on question history
- Loading branch information
Showing
15 changed files
with
256 additions
and
121 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,2 +1 @@ | ||
node_modules/ | ||
docker-compose.prod* |
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 |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# docker-compose for dev | ||
version: '3.8' | ||
|
||
services: | ||
frontend: | ||
build: | ||
context: ./frontend | ||
dockerfile: Dockerfile.dev | ||
args: | ||
PUBLIC_URL: ${PUBLIC_URL} | ||
WS_PUBLIC_URL: ${WS_PUBLIC_URL} | ||
FRONTEND_PORT: ${FRONTEND_PORT} | ||
QUESTION_API_PORT: ${QUESTION_API_PORT} | ||
USER_API_PORT: ${USER_API_PORT} | ||
MATCHING_API_PORT: ${MATCHING_API_PORT} | ||
COLLAB_API_PORT: ${COLLAB_API_PORT} | ||
ports: | ||
- "${FRONTEND_PORT}:${FRONTEND_PORT}" | ||
develop: | ||
watch: | ||
- action: sync | ||
path: ./frontend | ||
target: /app | ||
|
||
question: | ||
build: | ||
context: ./backend/question-service | ||
dockerfile: Dockerfile.dev | ||
ports: | ||
- "${QUESTION_API_PORT}:2000" | ||
develop: | ||
watch: | ||
- action: sync | ||
path: ./backend/question-service | ||
target: /app | ||
|
||
user: | ||
build: | ||
context: ./backend/user-service | ||
dockerfile: Dockerfile.prod | ||
env_file: | ||
- ./backend/user-service/.env | ||
ports: | ||
- "${USER_API_PORT}:3001" | ||
|
||
zookeeper: | ||
image: confluentinc/cp-zookeeper:7.7.1 | ||
environment: | ||
ZOOKEEPER_CLIENT_PORT: 2181 | ||
ports: | ||
- "2181:2181" | ||
healthcheck: | ||
test: [ "CMD", "echo", "ruok", "|", "nc", "localhost", "2181", "|", "grep", "imok" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
kafka: | ||
image: confluentinc/cp-kafka:7.7.1 | ||
ports: | ||
- "9092:9092" | ||
environment: | ||
KAFKA_BROKER_ID: 1 | ||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | ||
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 | ||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 | ||
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | ||
depends_on: | ||
zookeeper: | ||
condition: service_healthy | ||
healthcheck: | ||
test: [ "CMD", "nc", "-z", "localhost", "9092" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 10 | ||
|
||
matching-service: | ||
build: | ||
context: ./backend/matching-service | ||
dockerfile: Dockerfile.match | ||
environment: | ||
KAFKA_BROKER: kafka:9092 | ||
ports: | ||
- "${MATCHING_API_PORT}:3002" | ||
depends_on: | ||
kafka: | ||
condition: service_healthy | ||
|
||
collab-service: | ||
build: | ||
context: ./backend/collab-service | ||
dockerfile: Dockerfile.dev | ||
ports: | ||
- "${COLLAB_API_PORT}:3003" |
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 |
---|---|---|
|
@@ -34,5 +34,3 @@ yarn-error.log* | |
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts | ||
|
||
Dockerfile.prod |
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,54 @@ | ||
FROM node:22-alpine3.19 AS builder | ||
WORKDIR /app | ||
|
||
ARG PUBLIC_URL | ||
ARG WS_PUBLIC_URL | ||
ARG FRONTEND_PORT | ||
ARG QUESTION_API_PORT | ||
ARG USER_API_PORT | ||
ARG MATCHING_API_PORT | ||
ARG COLLAB_API_PORT | ||
|
||
ENV PUBLIC_URL=${PUBLIC_URL} | ||
ENV WS_PUBLIC_URL=${WS_PUBLIC_URL} | ||
|
||
ENV FRONTEND_PORT=${FRONTEND_PORT} | ||
ENV NEXT_PUBLIC_FRONTEND_URL=${PUBLIC_URL}:${FRONTEND_PORT} | ||
|
||
ENV QUESTION_API_PORT=${QUESTION_API_PORT} | ||
ENV NEXT_PUBLIC_QUESTION_API_BASE_URL=${PUBLIC_URL}:${QUESTION_API_PORT}/questions | ||
|
||
ENV USER_API_PORT=${USER_API_PORT} | ||
ENV USER_API_BASE_URL=${PUBLIC_URL}:${USER_API_PORT} | ||
ENV NEXT_PUBLIC_USER_API_AUTH_URL=${USER_API_BASE_URL}/auth | ||
ENV NEXT_PUBLIC_USER_API_USERS_URL=${USER_API_BASE_URL}/users | ||
ENV NEXT_PUBLIC_USER_API_EMAIL_URL=${USER_API_BASE_URL}/email | ||
ENV NEXT_PUBLIC_USER_API_HISTORY_URL=${USER_API_BASE_URL}/users/history | ||
|
||
ENV MATCHING_API_PORT=${MATCHING_API_PORT} | ||
ENV NEXT_PUBLIC_MATCHING_API_URL=${PUBLIC_URL}:${MATCHING_API_PORT}/matching | ||
|
||
ENV COLLAB_API_PORT=${COLLAB_API_PORT} | ||
ENV NEXT_PUBLIC_COLLAB_API_URL=${PUBLIC_URL}:${COLLAB_API_PORT} | ||
|
||
COPY package.json package-lock.json ./ | ||
RUN npm ci | ||
COPY . . | ||
ENV NEXT_TELEMETRY_DISABLED=1 | ||
RUN npm run build | ||
|
||
|
||
FROM node:22-alpine3.19 AS runner | ||
WORKDIR /app | ||
|
||
ENV NODE_ENV=production | ||
ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
||
RUN mkdir .next | ||
COPY --from=builder /app/.next/standalone ./ | ||
COPY --from=builder /app/.next/static ./.next/static | ||
COPY --from=builder /app/public ./public | ||
|
||
EXPOSE 3000 | ||
|
||
CMD ["node", "server.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
Oops, something went wrong.