Skip to content

Commit f5cfaa6

Browse files
committed
Comit Inicial
0 parents  commit f5cfaa6

37 files changed

+6558
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
npm-debug.log
3+
test

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/docker-image.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Build the Docker image
18+
run: docker build . --file Dockerfile --tag tasty-image:$(date +%s)

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# dependencies
2+
node_modules
3+
build
4+
src/c++/temp/hola_assembly.cpp
5+
.env

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
FROM node:16
2+
3+
RUN mkdir knockapi
4+
WORKDIR /knockapi
5+
6+
RUN apt-get update && apt-get install -y g++ make
7+
8+
COPY package*.json ./
9+
RUN npm ci
10+
COPY . .
11+
12+
RUN make install
13+
RUN npm run build
14+
15+
EXPOSE 3001
16+
17+
RUN useradd -ms /bin/bash tasty
18+
RUN chown -R tasty:tasty /knockapi/src/c++
19+
20+
# Cambiar permisos para app.js y archivos generados
21+
RUN chown tasty:tasty /knockapi/build/src/server/app.js
22+
RUN chmod 700 /knockapi/build/src/server/app.js
23+
24+
# Cambiar permisos para la carpeta build y subdirectorios
25+
RUN chown -R tasty:tasty /knockapi/build
26+
RUN chmod -R 700 /knockapi/build
27+
28+
USER tasty
29+
30+
CMD node ./build/src/server/app.js

Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
EJECUTABLE = $(DIR_BIN)/$(title)
2+
DIR_INC = ./src/c++/addons/headers
3+
DIR_MAIN = ./src/c++/addons/sources
4+
DIR_OBJ = ./src/c++/temp/$(title)_obj
5+
DIR_BIN = ./src/c++/temp/$(title)_bin
6+
7+
OBJETOS = $(DIR_OBJ)/$(title).o \
8+
$(DIR_OBJ)/http.o \
9+
$(DIR_OBJ)/veridic.o
10+
11+
12+
13+
CPPFLAGS = -std=$(standar) -lcurl -I$(DIR_INC) -pthread
14+
COMPILER = g++
15+
BUILD = $(COMPILER) $(OBJETOS) $(CPPFLAGS) -o $(EJECUTABLE)
16+
DATA_ROUTE = ./src/c++/temp/$(title).txt
17+
18+
ifeq ($(data),1)
19+
BUILD = $(COMPILER) $(OBJETOS) $(CPPFLAGS) -o $(EJECUTABLE) < $(DATA_ROUTE)
20+
endif
21+
22+
23+
$(EJECUTABLE) : $(OBJETOS)
24+
@mkdir -p $(DIR_BIN)
25+
@$(BUILD)
26+
27+
$(DIR_OBJ)/%.o : $(DIR_MAIN)/**/%.cpp
28+
@mkdir -p $(DIR_OBJ)
29+
@$(COMPILER) -c -MD $(CPPFLAGS) $< -o $@
30+
-include $(DIR_OBJ)/*.d
31+
32+
.PHONY: clean install
33+
clean:
34+
@rm -r $(DIR_BIN) $(DIR_OBJ)
35+
36+
install:
37+
38+
apt-get install curl
39+
apt-get install openssl -y
40+
apt-get install libcurl4-openssl-dev -y

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)