wip
This commit is contained in:
parent
aa96d79e47
commit
1bc33ab912
28 changed files with 94 additions and 18 deletions
2
src/icons-service/.dockerignore
Normal file
2
src/icons-service/.dockerignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/dist
|
||||
/node_modules
|
||||
31
src/icons-service/Dockerfile
Normal file
31
src/icons-service/Dockerfile
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# **************************************************************************** #
|
||||
# #
|
||||
# ::: :::::::: #
|
||||
# Dockerfile :+: :+: :+: #
|
||||
# +:+ +:+ +:+ #
|
||||
# By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ #
|
||||
# +#+#+#+#+#+ +#+ #
|
||||
# Created: 2025/06/16 14:57:11 by maiboyer #+# #+# #
|
||||
# Updated: 2025/06/16 15:28:33 by maiboyer ### ########.fr #
|
||||
# #
|
||||
# **************************************************************************** #
|
||||
|
||||
FROM node:24-alpine AS builder
|
||||
|
||||
# Don't forget to edit the .dockerignore if needed
|
||||
COPY . /app
|
||||
|
||||
WORKDIR /app
|
||||
RUN npm install && npm run build:ts;
|
||||
|
||||
FROM node:24-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/dist ./dist
|
||||
COPY --from=builder /app/package*.json .
|
||||
|
||||
RUN npm ci --omit=dev;
|
||||
# Start the app
|
||||
CMD ["node", "dist/run.js"]
|
||||
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"type": "module",
|
||||
"name": "user-icons",
|
||||
"name": "icons-service",
|
||||
"version": "1.0.0",
|
||||
"description": "This project was bootstrapped with Fastify-CLI.",
|
||||
"main": "app.ts",
|
||||
16
src/icons-service/src/run.ts
Normal file
16
src/icons-service/src/run.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
// this sould only be used by the docker file !
|
||||
|
||||
import fastify, { FastifyInstance } from "fastify";
|
||||
import app from './app.js'
|
||||
|
||||
const start = async () => {
|
||||
const f: FastifyInstance = fastify({logger: true});
|
||||
try {
|
||||
await f.register(app, {});
|
||||
await f.listen({ port: 80, host: '0.0.0.0' })
|
||||
} catch (err) {
|
||||
f.log.error(err)
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
start()
|
||||
Loading…
Add table
Add a link
Reference in a new issue