update docker and change api path

This commit is contained in:
Carl-Gerhard Lindesvärd
2023-10-12 07:24:21 +02:00
parent c540cc38cc
commit 2a99eee71c
3 changed files with 7 additions and 14 deletions

View File

@@ -1,2 +1,3 @@
**/.env
**/node_modules
**/dist

View File

@@ -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
ENV DATABASE_URL=$DATABASE_URL
ENV PORT=3000
ENV NODE_ENV=production
# For prisma
ARG NODE_VERSION=18
RUN apt update \
@@ -23,10 +19,9 @@ COPY packages/types/package.json packages/types/package.json
COPY bun.lockb bun.lockb
RUN bun install
COPY . .
WORKDIR /app/apps/backend
RUN bunx prisma generate
WORKDIR /app/apps/backend
EXPOSE ${PORT}
CMD ["bun", "start"]

View File

@@ -4,18 +4,15 @@ import profiles from './routes/profiles'
import { authMiddleware } from "./middlewares/auth";
import morgan from 'morgan'
const app = express();
const port = process.env.PORT || 8080;
app.use(morgan('tiny'))
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(events)
app.use(profiles)
app.get("/ping", (req, res) => res.json("pong"));
app.use('/api/sdk',events)
app.use('/api/sdk',profiles)
app.listen(port, () => {
console.log(`Listening on port ${port}...`);
});