mirror of
https://git.rezel.net/LudoTech/traque.git
synced 2026-02-09 02:10:18 +01:00
Seperated docker files for deployment and development + update readme.md
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Use Node 20 alpine as parent image
|
||||
# Use Node 22 alpine as parent image
|
||||
FROM node:22-alpine
|
||||
|
||||
# Change the working directory on the Docker image to /app
|
||||
@@ -13,11 +13,12 @@ RUN npm install
|
||||
# Copy the rest of project files into this image
|
||||
COPY . .
|
||||
|
||||
# Create those folders if they don't already exist
|
||||
RUN if [ ! -d uploads ]; then mkdir uploads; fi
|
||||
|
||||
RUN if [ ! -d trajectories ]; then mkdir trajectories; fi
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 3001
|
||||
|
||||
# Start the application
|
||||
CMD npm start
|
||||
CMD ["npm", "run", "start"]
|
||||
|
||||
27
traque-back/Dockerfile.dev
Normal file
27
traque-back/Dockerfile.dev
Normal file
@@ -0,0 +1,27 @@
|
||||
# Use Node 22 alpine as parent image
|
||||
FROM node:22-alpine
|
||||
|
||||
# Change the working directory on the Docker image to /app
|
||||
WORKDIR /app
|
||||
|
||||
# Change specified variables
|
||||
ENV NODE_ENV=development
|
||||
|
||||
# Copy package.json and package-lock.json to the /app directory
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install
|
||||
|
||||
# Copy the rest of project files into this image
|
||||
COPY . .
|
||||
|
||||
# Create those folders if they don't already exist
|
||||
RUN if [ ! -d uploads ]; then mkdir uploads; fi
|
||||
RUN if [ ! -d trajectories ]; then mkdir trajectories; fi
|
||||
|
||||
# Expose the port
|
||||
EXPOSE 3001
|
||||
|
||||
# Start the server in dev mode
|
||||
CMD ["npm", "run", "dev"]
|
||||
1071
traque-back/package-lock.json
generated
1071
traque-back/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,8 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node index.js"
|
||||
"start": "node index.js",
|
||||
"dev": "nodemon index.js"
|
||||
},
|
||||
"author": "Quentin Roussel",
|
||||
"license": "ISC",
|
||||
@@ -16,5 +17,8 @@
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"random-location": "^1.1.3",
|
||||
"socket.io": "^4.7.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^3.1.10"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user