mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-08-14 12:32:54 +02:00
「🏗️」 wip: Started docker setup - made node base image
This commit is contained in:
@ -1,6 +1,10 @@
|
|||||||
|
# nix thing
|
||||||
flake.nix
|
flake.nix
|
||||||
flake.lock
|
flake.lock
|
||||||
|
|
||||||
docker/
|
# node thing
|
||||||
|
|
||||||
node_modules/
|
node_modules/
|
||||||
|
|
||||||
|
# useless files in the docker
|
||||||
|
*.md
|
||||||
|
docker/
|
||||||
|
32
dev.js
32
dev.js
@ -1,32 +0,0 @@
|
|||||||
import Fastify from 'fastify';
|
|
||||||
import authApi from './api/auth/default.js';
|
|
||||||
import userApi from './api/user/default.js';
|
|
||||||
|
|
||||||
const loggerOption = {
|
|
||||||
transport: {
|
|
||||||
target: 'pino-pretty',
|
|
||||||
options: {
|
|
||||||
colorize: true,
|
|
||||||
translateTime: 'HH:MM:ss',
|
|
||||||
ignore: 'pid,hostname'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
async function start() {
|
|
||||||
const auth = Fastify({
|
|
||||||
logger: loggerOption
|
|
||||||
});
|
|
||||||
auth.register(authApi);
|
|
||||||
await auth.listen({ port: 3001 });
|
|
||||||
console.log('Auth API listening on http://localhost:3001');
|
|
||||||
|
|
||||||
const user = Fastify({
|
|
||||||
logger: loggerOption
|
|
||||||
});
|
|
||||||
user.register(userApi);
|
|
||||||
await user.listen({ port: 3002 });
|
|
||||||
console.log('User data API listening on http://localhost:3002');
|
|
||||||
}
|
|
||||||
|
|
||||||
start().catch(console.error);
|
|
10
docker/docker-compose.yml
Normal file
10
docker/docker-compose.yml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
services:
|
||||||
|
front:
|
||||||
|
image: owasp/modsecurity-crs:nginx-alpine
|
||||||
|
ports:
|
||||||
|
- 443:443
|
||||||
|
# environment:
|
||||||
|
# - euuuh
|
||||||
|
user-api:
|
||||||
|
image:
|
||||||
|
cmd:
|
0
docker/front/Dockerfile
Normal file
0
docker/front/Dockerfile
Normal file
21
docker/node-base/Dockerfile
Normal file
21
docker/node-base/Dockerfile
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
FROM node:lts-alpine AS builder
|
||||||
|
|
||||||
|
# copy all the nessecary file to download the dependency
|
||||||
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml /app/
|
||||||
|
|
||||||
|
# install all the dependency
|
||||||
|
RUN npm install -g pnpm
|
||||||
|
RUN cd /app \
|
||||||
|
&& pnpm install --prod
|
||||||
|
|
||||||
|
FROM node:lts-alpine AS base
|
||||||
|
|
||||||
|
# copy the source files
|
||||||
|
COPY src /app/src
|
||||||
|
|
||||||
|
# copy the downloaded files
|
||||||
|
COPY --from=builder /app/node_modules /app/node_modules
|
||||||
|
COPY --from=builder /app/pnpm-lock.yaml /app/pnpm-lock.yaml
|
||||||
|
COPY --from=builder /app/package.json /app/package.json
|
||||||
|
|
||||||
|
ENV NODE_ENV=production
|
0
docker/user-api/Dockerfile
Normal file
0
docker/user-api/Dockerfile
Normal file
Reference in New Issue
Block a user