ajout de frontend fonctionnel :)
This commit is contained in:
+12
-16
@@ -22,8 +22,8 @@ services:
|
||||
backend:
|
||||
container_name: backend
|
||||
build: ./srcs/backend
|
||||
ports:
|
||||
- "3001:3001"
|
||||
expose:
|
||||
- "3001"
|
||||
depends_on:
|
||||
- database
|
||||
# volumes:
|
||||
@@ -34,17 +34,13 @@ services:
|
||||
- transcendence
|
||||
restart: always
|
||||
|
||||
# frontend:
|
||||
# container_name: frontend
|
||||
# build: ./docker/frontend
|
||||
# ports:
|
||||
# - "3000:3000"
|
||||
# depends_on:
|
||||
# - backend
|
||||
# volumes:
|
||||
# //
|
||||
# env_file:
|
||||
# //
|
||||
# networks:
|
||||
# - transcendence
|
||||
# restart: always
|
||||
frontend:
|
||||
container_name: frontend
|
||||
build: ./srcs/frontend/
|
||||
ports:
|
||||
- "8080:80"
|
||||
depends_on:
|
||||
- backend
|
||||
networks:
|
||||
- transcendence
|
||||
restart: always
|
||||
@@ -76,7 +76,7 @@ async function startServer()
|
||||
|
||||
await createTables();
|
||||
|
||||
app.get('/', (req, res) => res.send('Backend running'));
|
||||
app.get('/api/', (req, res) => res.send('Backend running'));
|
||||
|
||||
app.listen(3001, () =>
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FROM nginx:20-alpine
|
||||
FROM nginx:alpine
|
||||
COPY src /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@@ -0,0 +1,18 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Frontend
|
||||
location / {
|
||||
try_files $uri /index.html;
|
||||
}
|
||||
|
||||
# Backend API
|
||||
location /api/ {
|
||||
proxy_pass http://backend:3001/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user