Skip to content
Snippets Groups Projects
Commit fc484601 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

Merge branch 'dev' of...

parents 84b9facd 38c46b08
No related branches found
No related tags found
1 merge request!4Feat/pipeline
Pipeline #15409 failed
node_modules
build
.dockerignore
\ No newline at end of file
# Stage 0, "build-stage", based on Node.js, to build and compile the frontend
FROM node:14-alpine as build-stage
WORKDIR /app
COPY package*.json /app/
RUN npm install
COPY ./ /app/
RUN npm run build
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.16
COPY --from=build-stage /app/build/ /usr/share/nginx/html
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
COPY ./nginx/site.pro.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
\ No newline at end of file
# Client - LLLE # Client - LLLE
Projet client du backoffice LLLE Projet client du backoffice LLLE
## Local usage
```bash
docker-compose up -d
```
\ No newline at end of file
version: '3.7'
services:
nginx:
image: backoffice #TODO: replace with forge image tag
build:
context: .
restart: unless-stopped
ports:
- 8080:80
version: '3.7'
services:
nginx:
image: nginx:1.16
restart: unless-stopped
volumes:
- ./nginx/site.conf:/etc/nginx/conf.d/default.conf
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
command: ["nginx", "-g", "daemon off;"]
ports:
- 8081:8080
networks:
backoffice:
depends_on:
- front
links:
- front
front:
image: bayesimpact/react-base
restart: unless-stopped
volumes:
- ./:/usr/app
working_dir: /usr/app
ports:
- 3000:3000
networks:
backoffice:
networks:
backoffice:
\ No newline at end of file
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;
#tcp_nopush on;
keepalive_timeout 65;
# Gzip conf
gzip on;
gzip_vary on; # tells proxies to cache both gzipped and regular versions of a resource
gzip_min_length 256; # taille minimale du fichier à compresser
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
include /etc/nginx/conf.d/*.conf;
# Max Body Size
client_max_body_size 2M;
}
server {
listen 8080;
server_name localhost;
location / {
proxy_pass http://front:3000;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
add_header Access-Control-Allow-Origin *;
}
}
server {
listen 80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"docker": "docker run -it --rm -p 3000:3000 front-backoffice",
"lint": "eslint .", "lint": "eslint .",
"lint:fix": "eslint --fix .", "lint:fix": "eslint --fix .",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"", "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
......
Source diff could not be displayed: it is too large. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment