update docker and change api path
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
**/.env
|
**/.env
|
||||||
**/node_modules
|
**/node_modules
|
||||||
|
**/dist
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
FROM --platform=linux/amd64 oven/bun:1.0.5-slim
|
FROM --platform=linux/amd64 oven/bun:1.0.5-slim as builder
|
||||||
|
|
||||||
ARG DATABASE_URL
|
ARG DATABASE_URL
|
||||||
ENV DATABASE_URL=$DATABASE_URL
|
ENV DATABASE_URL=$DATABASE_URL
|
||||||
|
|
||||||
ENV PORT=3000
|
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
|
|
||||||
# For prisma
|
# For prisma
|
||||||
ARG NODE_VERSION=18
|
ARG NODE_VERSION=18
|
||||||
RUN apt update \
|
RUN apt update \
|
||||||
@@ -23,10 +19,9 @@ COPY packages/types/package.json packages/types/package.json
|
|||||||
COPY bun.lockb bun.lockb
|
COPY bun.lockb bun.lockb
|
||||||
RUN bun install
|
RUN bun install
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
WORKDIR /app/apps/backend
|
WORKDIR /app/apps/backend
|
||||||
RUN bunx prisma generate
|
RUN bunx prisma generate
|
||||||
|
WORKDIR /app/apps/backend
|
||||||
EXPOSE ${PORT}
|
EXPOSE ${PORT}
|
||||||
CMD ["bun", "start"]
|
CMD ["bun", "start"]
|
||||||
|
|
||||||
|
|||||||
@@ -4,18 +4,15 @@ import profiles from './routes/profiles'
|
|||||||
import { authMiddleware } from "./middlewares/auth";
|
import { authMiddleware } from "./middlewares/auth";
|
||||||
import morgan from 'morgan'
|
import morgan from 'morgan'
|
||||||
|
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = process.env.PORT || 8080;
|
const port = process.env.PORT || 8080;
|
||||||
|
|
||||||
app.use(morgan('tiny'))
|
|
||||||
app.use(express.json());
|
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
app.use(morgan(':method :url :status :response-time ms'))
|
||||||
|
app.get("/", (req, res) => res.json("Welcome to Mixan"));
|
||||||
app.use(authMiddleware)
|
app.use(authMiddleware)
|
||||||
app.use(events)
|
app.use('/api/sdk',events)
|
||||||
app.use(profiles)
|
app.use('/api/sdk',profiles)
|
||||||
app.get("/ping", (req, res) => res.json("pong"));
|
|
||||||
|
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
console.log(`Listening on port ${port}...`);
|
console.log(`Listening on port ${port}...`);
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user