Compare commits
2 Commits
780f5e86c6
...
310bec2d74
| Author | SHA1 | Date | |
|---|---|---|---|
| 310bec2d74 | |||
| 8ac13f6360 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -21,3 +21,6 @@ pnpm-debug.log*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
|
||||
#dockerfile
|
||||
dockerfile
|
||||
|
||||
37
dockerfile
Normal file
37
dockerfile
Normal file
@@ -0,0 +1,37 @@
|
||||
# Étape 1 : Construction (Build)
|
||||
FROM node:20-slim AS build-stage
|
||||
|
||||
# Définit le dossier de travail
|
||||
WORKDIR /app
|
||||
|
||||
# Copie les fichiers de dépendances
|
||||
COPY package*.json ./
|
||||
|
||||
# Installe les dépendances
|
||||
RUN npm install
|
||||
|
||||
# Copie le reste des fichiers du projet
|
||||
COPY . .
|
||||
|
||||
# Construit l'application pour la production
|
||||
RUN npm run build
|
||||
|
||||
# Étape 2 : Serveur de production (Nginx)
|
||||
FROM nginx:stable-alpine AS production-stage
|
||||
|
||||
# Copie les fichiers compilés depuis l'étape de build
|
||||
COPY --from=build-stage /app/dist /usr/share/nginx/html
|
||||
|
||||
# Ajoute une configuration Nginx simple pour gérer le routage Vue (SPA)
|
||||
RUN echo 'server { \
|
||||
listen 80; \
|
||||
location / { \
|
||||
root /usr/share/nginx/html; \
|
||||
index index.html; \
|
||||
try_files $uri $uri/ /index.html; \
|
||||
} \
|
||||
}' > /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -5,20 +5,17 @@ export const formService =
|
||||
// Propriété qui stocke la BASE URL de notre API
|
||||
//base_url : "http://192.168.42.124/projets_wordpress/BOPortfolio/wordpress/wp-json/",
|
||||
//base_url : "http://192.168.1.41/projets_wordpress/BOPortfolio/wordpress/wp-json/",
|
||||
base_url : "https://bo-portfolio.raffiskender.com/wp-json/",
|
||||
base_url : "https://orange-firefly-f5a4.raffiskender.workers.dev/",
|
||||
//base_url : "http://localhost/projets_wordpress/BOPortfolio/wordpress/wp-json/",
|
||||
|
||||
// Retrieve data from backend
|
||||
async sendMessage(token, payload)
|
||||
{
|
||||
//console.log(token, payload);
|
||||
|
||||
|
||||
|
||||
const response = await axios.post(
|
||||
this.base_url + "bo-portfolio/v1/submitForm",
|
||||
this.base_url,
|
||||
{
|
||||
token: token,
|
||||
token,
|
||||
json: payload
|
||||
},
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ const onSubmit = () => {
|
||||
{action: 'submit'})
|
||||
.then( async (token) => {
|
||||
const response = await formService.sendMessage(token, payload)
|
||||
//console.log(response)
|
||||
if (response === true){
|
||||
awaiting.value = false;
|
||||
name.value = '';
|
||||
|
||||
Reference in New Issue
Block a user