Skip to content

Commit ecf8df6

Browse files
Merge pull request #12 from misterx901/main
Ajustes conforme novo arquivo docker-compose que vai rodar front e back
2 parents 5717269 + 6e2e37e commit ecf8df6

10 files changed

+205
-34
lines changed

Dockerfile

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,58 @@
1-
FROM node:14 as servidor_mapas
1+
# --- STAGE 1: Build & Setup stage ---
2+
# Use the specific base image you require (Node 16 with Bullseye)
3+
FROM node:16-bullseye AS build
4+
WORKDIR /app
25

3-
WORKDIR /usr/src/app
6+
# Install necessary system dependencies (Python/Pip/other libs)
7+
RUN apt-get update && \
8+
apt-get install -y --no-install-recommends \
9+
python3 python3-pip \
10+
# Add any other required build dependencies here
11+
&& rm -rf /var/lib/apt/lists/*
412

5-
COPY package.json ./
6-
COPY tsconfig.json ./
13+
# Install Python packages
14+
RUN pip3 install --no-cache-dir numpy pillow lxml fastapi
715

8-
COPY ./src ./src
9-
COPY ./prisma ./prisma
10-
COPY ./@types ./@types
16+
# Create necessary directories
17+
RUN mkdir -p /app/assets/xml /app/assets/maps /app/assets/thumbs /app/uploads
1118

12-
RUN npm install --force
19+
20+
# Install Node dependencies
21+
COPY package*.json ./
22+
COPY prisma ./prisma
23+
# 'npm ci --omit=dev' is excellent for production
24+
RUN npm ci --omit=dev || npm install --force
25+
26+
# Generate Prisma client
1327
RUN npm run prisma:gen
28+
29+
# Build the application (e.g., TypeScript compilation)
30+
COPY . .
1431
RUN npm run build
1532

16-
ENV DATABASE_URL="mysql://root:@Cj08310799@127.0.0.1:3306/servidor_mapas"
17-
ENV PORT=8888
33+
# --- STAGE 2: Production Run stage ---
34+
# Use a smaller/more secure runtime if possible (e.g., Node 16 slim/alpine, but careful with native modules)
35+
# Stick to the same base for maximum compatibility since we installed system libs
36+
FROM node:16-bullseye
37+
WORKDIR /ena-map-server-back
38+
39+
# Install *only* runtime dependencies if necessary (e.g., python/pip/libs needed at runtime)
40+
# Re-install system packages necessary for runtime:
41+
RUN apt-get update && \
42+
apt-get install -y --no-install-recommends \
43+
python3 python3-pip \
44+
# Add any other required runtime dependencies here
45+
&& rm -rf /var/lib/apt/lists/*
46+
RUN pip3 install --no-cache-dir numpy pillow lxml fastapi
47+
48+
# Copy only the necessary files from the build stage
49+
# Note: /app is the build directory, /ena-map-server-back is the final working directory
50+
COPY --from=build /app /ena-map-server-back
51+
52+
EXPOSE 8888
1853

19-
EXPOSE 80
20-
EXPOSE 443
21-
EXPOSE 8080
54+
# Set environment variables (optional, better in docker-compose)
55+
# ENV NODE_ENV production
2256

57+
# The final production start command
2358
CMD ["npm", "start"]
954 Bytes
Loading
954 Bytes
Loading
954 Bytes
Loading
954 Bytes
Loading
955 Bytes
Loading
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<root xmlns="http://www.w3.org/1999/xhtml"><layers><layer name="floor" tileset="floor">5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,3.1,3.1,3.1,3.1,3.1,3.1,3.1,3.1
2+
3+
,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,3.1,3.1,3.1,3.1,3.1,3.1,3.1,3.1
4+
5+
,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,3.1,3.1,3.1,3.1,3.1,3.1,3.1,3.1
6+
7+
,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,3.1,3.1,3.1,3.1,3.1,3.1,3.1,3.1
8+
9+
,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,4.0,3.1,3.1,3.1,3.1,3.1,3.1,3.1,3.1
10+
11+
,5.0,5.0,5.0,5.0,5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-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
134+
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
135+
,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
136+
</layer></layers><tilesets><tileset name="walls" image="walls" imagewidth="224" imageheight="94" tilewidth="32" tileheight="32"></tileset><tileset name="floor" image="floor" imagewidth="256" imageheight="64" tilewidth="32" tileheight="32"></tileset><tileset name="door_and_windows" image="door_and_windows" imagewidth="253" imageheight="96" tilewidth="32" tileheight="32"></tileset><tileset name="utensils" image="utensils" imagewidth="246" imageheight="127" tilewidth="32" tileheight="32"></tileset><tileset name="eletronics" image="eletronics" imagewidth="252" imageheight="127" tilewidth="32" tileheight="32"></tileset><tileset name="persons" image="persons" imagewidth="121" imageheight="29" tilewidth="32" tileheight="32"></tileset><tileset name="interactive_elements" image="interactive_elements" imagewidth="252" imageheight="124" tilewidth="32" tileheight="32"></tileset><tileset name="furniture" image="furniture" imagewidth="256" imageheight="444" tilewidth="32" tileheight="32"></tileset></tilesets><canvas width="800" height="480"></canvas></root>

example.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
DATABASE_URL=mysql://root:root@localhost:3306/servidor_mapas
1+
DATABASE_URL=mysql://admin:Cefet@2025!@172.22.0.20:3306/servidor_mapas
22
JWT_SECRET=abcd1234-ab12-ba12-1212-123456789abc

src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export default class Server {
6565
origin: '*',
6666
}),
6767
);
68-
this.express.use('/image/', express.static('./assets/img'));
68+
this.express.use('/image', express.static(path.join(process.cwd(), 'assets', 'img')));
6969
dotenv.config();
7070
}
7171

src/services/MapService.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CrudService } from './CrudService';
44
import { scriptReader } from '../utils/scriptReader';
55
import fs from 'fs';
66
import path from 'path';
7-
import { groupMapRepositoryByIdMap } from '../repository/GroupMapRepository';
7+
import { groupMapRepositoryByIdMap } from '../repository/GroupMapRepository';
88
import { userMapRepository } from '../repository/UserMapRepository';
99

1010
class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
@@ -17,7 +17,7 @@ class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
1717
}
1818

1919

20-
async saveXmlFile(data: any) {
20+
async saveXmlFile(data: any) {
2121
const pathName = path.resolve(
2222
__dirname,
2323
'../../',
@@ -31,11 +31,11 @@ class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
3131
return await scriptReader.convertXmlToJson(data);
3232
}
3333

34-
async deleteOldFileXml(data: any) {
34+
async deleteOldFileXml(fileName: string) {
3535
const pathName = path.resolve(
3636
__dirname,
3737
'../../',
38-
`assets/xml/${data.fileName.toLowerCase().replace(' ', '-')}.xml`,
38+
`assets/xml/${fileName.toLowerCase().replace(' ', '-')}.xml`,
3939
);
4040

4141
fs.unlinkSync(pathName);
@@ -47,12 +47,12 @@ class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
4747
url: data.url,
4848
}
4949

50-
if(data.new_file === 'true') {
51-
this.deleteOldFileXml(data.last_file_name)
52-
this.saveXmlFile({ name: data.files[0].name, file: data.files[0] })
50+
if (data.new_file === 'true' && data.last_file_name) {
51+
this.deleteOldFileXml(data.last_file_name);
52+
this.saveXmlFile({ name: data.files[0].name, file: data.files[0] })
5353
const mapJson = await this.convertXmlFile({ name: data.files[0].name, minify: true, file: data.files[0] });
5454

55-
if(!mapJson) {
55+
if (!mapJson) {
5656
throw new Error('Failed to convert JSON');
5757
}
5858

@@ -62,7 +62,7 @@ class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
6262

6363

6464
return mapRepository.update(id, newData);
65-
65+
6666
}
6767

6868
override async create(data: CreateMapConvert): Promise<any> {
@@ -72,19 +72,19 @@ class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
7272
id_owner: parseInt(`${data.id_owner}`),
7373
}
7474

75-
this.saveXmlFile({ name: data.files[0].name, file: data.files[0] })
76-
const mapJson = await this.convertXmlFile({ name: data.files[0].name, minify: true, file: data.files[0] });
75+
this.saveXmlFile({ name: data.files[0].name, file: data.files[0] })
76+
const mapJson = await this.convertXmlFile({ name: data.files[0].name, minify: true, file: data.files[0] });
7777

78-
if(!mapJson) {
79-
throw new Error('Failed to convert JSON');
80-
}
78+
if (!mapJson) {
79+
throw new Error('Failed to convert JSON');
80+
}
8181

8282
newData.tag = JSON.stringify(mapJson);
8383
newData.thumb_url = data.files[0].name;
84-
84+
8585
return mapRepository.create(newData);
8686
}
87-
87+
8888
override async delete(id:number):Promise<any> {
8989

9090
const mapSelected = await mapRepository.getById(id);
@@ -103,7 +103,7 @@ class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
103103
const mapResponse = await mapRepository.getById(idMapa);
104104

105105
if (mapResponse) {
106-
106+
107107
const pathName = path.resolve(
108108
__dirname,
109109
'../../',
@@ -159,13 +159,13 @@ class MapService extends CrudService<MapDTO, CreateMapDTO, UpdateMapDTO> {
159159
}
160160
}
161161

162-
162+
163163
async findAllPaged(page: string, limit: string, search: string): Promise<any | null> {
164164
const users = await mapRepository.getAllPaged(page, limit, search);
165165
const count = await mapRepository.countAll();
166166

167167
const take = limit ? Number(limit) : users.length;
168-
return { data: users, limit: take, page: Number(page), count};
168+
return { data: users, limit: take, page: Number(page), count };
169169
}
170170
}
171171

0 commit comments

Comments
 (0)