finish project
parent
06ec629862
commit
de982c6608
@ -0,0 +1,32 @@
|
||||
FROM node:18-alpine AS builder
|
||||
|
||||
WORKDIR "/app"
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm ci
|
||||
|
||||
RUN npm run build
|
||||
|
||||
RUN npm prune --production
|
||||
|
||||
FROM node:18-alpine AS prod
|
||||
|
||||
WORKDIR "/app"
|
||||
|
||||
COPY --from=builder /app/package.json ./package.json
|
||||
COPY --from=builder /app/package-lock.json ./package-lock.json
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
|
||||
ENV DB_HOST
|
||||
ENV DB_PORT
|
||||
ENV DB_USER
|
||||
ENV DB_PASS
|
||||
ENV DB_NAME
|
||||
ENV JWT_SECRET
|
||||
ENV JWT_EXPIRY
|
||||
|
||||
CMD ["sh", "-c", "DB_HOST=${DB_HOST} DB_PORT=${DB_PORT} DB_USER=${DB_USER} DB_PASS=${DB_PASS} DB_NAME=${DB_NAME} JWT_SECRET=${JWT_SECRET} JWT_EXPIRY=${JWT_EXPIRY} npm run start:prod --host 0.0.0.0"]
|
||||
|
||||
EXPOSE 3000
|
@ -1,16 +1,17 @@
|
||||
# Mx Leaderboard API
|
||||
|
||||
## todos
|
||||
Basic leaderboard api using next js, mariadb and typescript.
|
||||
|
||||
- [x] user api
|
||||
- [x] signup
|
||||
- [x] login
|
||||
- [x] leaderboard api
|
||||
- [x] add 20 pts
|
||||
- [x] add 60 pts
|
||||
- [x] add 100 pts
|
||||
- [x] get standings
|
||||
- [x] get user score history
|
||||
- [x] controller tests
|
||||
- [x] user
|
||||
- [x] rank
|
||||
## Development
|
||||
|
||||
- Copy `.env.example` to `.env`, and add relevant information
|
||||
- `pnpm install`
|
||||
- `pnpm start:dev`
|
||||
|
||||
## Deployment
|
||||
|
||||
- Copy `.env.example` to `.env`, and add relevant information
|
||||
- `npm run ci`
|
||||
- `npm run build`
|
||||
- `npm prune --production`
|
||||
- `npm start:prod --host 0.0.0.0`
|
||||
|
Loading…
Reference in New Issue