mirror of
https://github.com/Floriansylvain/ParisMuseesQuizz.git
synced 2026-08-19 11:43:22 +02:00
Production ready
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
FROM node:latest as build-stage
|
||||
WORKDIR /app
|
||||
COPY ./web/package*.json ./
|
||||
COPY ./.env ./
|
||||
RUN npm ci
|
||||
COPY ./web/ .
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx as production-stage
|
||||
RUN mkdir /app
|
||||
COPY --from=build-stage /app/dist /app
|
||||
COPY ./web/nginx.conf /etc/nginx/nginx.conf
|
||||
@@ -12,6 +12,8 @@
|
||||
### For website
|
||||
|
||||
- API_ADDRESS
|
||||
- FRONT_PORT
|
||||
- FRONT_BASE_PATH
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
+15
-1
@@ -16,7 +16,9 @@ services:
|
||||
timeout: 30s
|
||||
retries: 10
|
||||
backend:
|
||||
build: .
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./Dockerfile.backend
|
||||
image: parismuseesquizz-backend
|
||||
depends_on:
|
||||
db:
|
||||
@@ -29,6 +31,18 @@ services:
|
||||
- back-net
|
||||
ports:
|
||||
- "${API_PORT}:${API_PORT}"
|
||||
frontend:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: ./Dockerfile.frontend
|
||||
image: parismuseesquizz-frontend
|
||||
env_file:
|
||||
- .env
|
||||
ports:
|
||||
- "${FRONT_PORT}:80"
|
||||
networks:
|
||||
- front-net
|
||||
|
||||
networks:
|
||||
back-net:
|
||||
front-net:
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<link rel="icon" href="/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Vite App</title>
|
||||
<title>Quizz Paris Musées</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
user nginx;
|
||||
worker_processes 1;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
pid /var/run/nginx.pid;
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
access_log /var/log/nginx/access.log main;
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
location / {
|
||||
root /app;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,5 +21,6 @@ export default defineConfig(({ command, mode }): UserConfig => {
|
||||
...env2,
|
||||
},
|
||||
},
|
||||
base: env1.FRONT_BASE_PATH ?? env2.FRONT_BASE_PATH ?? "/",
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user