-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Aggiunto Dockerfile e docker-compose.yml per testing * App remote env set * Url del server socket.io tramite ENV * Stampa tutte le ENV (docker debug) * Build immagine; Configurazione reverse proxy nginx * Aggiunto client al network privato docker * Reverse proxy al server api * Serving del archivio e api * Rimosso "backend" da docker file e docker compose * Rimosso script di debug * Riportato VueSocket a configurazione di default * aggiunto proxypass per socket.io * Rimosso "/" che causava problemi * Update main.js * Nuova configurazione per proxy socket.io * Socket.io rp; pics; images FIXME: cartella /client servita staticamente nella root del api * Socket io reverse proxy * Unlimited body size!
- Loading branch information
1 parent
90f9515
commit 6fd1c02
Showing
4 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
FROM node:10.15.1-jessie-slim as builder | ||
|
||
WORKDIR /tmp | ||
COPY package.json package.json | ||
RUN yarn | ||
|
||
COPY . . | ||
RUN yarn build | ||
|
||
FROM nginx:latest | ||
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf | ||
WORKDIR /usr/nginx/html | ||
COPY --from=builder /tmp/dist . | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
version: "2" | ||
|
||
services: | ||
frontend: | ||
build: . | ||
image: archivio-fermi-client | ||
restart: always | ||
container_name: archivio-client | ||
ports: | ||
- 80:80 | ||
depends_on: | ||
- backend | ||
networks: | ||
- api-network | ||
|
||
backend: # Usa sempre backend come nome del server api PS: se lo cambi cambia anche nginx.conf | ||
image: prons/archivio-fermi-server:latest | ||
container_name: archivio-server | ||
restart: always | ||
environment: | ||
MONGODB_URI: "mongodb://database:27017/archivio" | ||
JWT_SECRET: 3xWXqcDzt86YGKr2zP | ||
NODE_ENV: development | ||
volumes: | ||
- server-data:/usr/app/server/public | ||
depends_on: | ||
- database | ||
networks: | ||
- api-network | ||
|
||
database: | ||
image: mongo:3.4.19-jessie | ||
container_name: archivio-db | ||
restart: always | ||
volumes: | ||
- database-data:/data/db | ||
- database-config:/data/configdb | ||
environment: | ||
MONGO_INITDB_DATABASE: archivio | ||
networks: | ||
- api-network | ||
|
||
networks: | ||
api-network: | ||
driver: bridge | ||
|
||
volumes: | ||
database-data: | ||
database-config: | ||
server-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
worker_processes 1; ## Default: 1 | ||
|
||
events { worker_connections 1024; } | ||
|
||
http { | ||
sendfile on; | ||
client_max_body_size 0; | ||
|
||
upstream backendapi { | ||
server backend:3000; | ||
} | ||
|
||
server { | ||
listen 80; | ||
allow all; | ||
|
||
root /usr/nginx/html; | ||
|
||
location /signup { | ||
proxy_pass http://backendapi$uri$is_args$args; | ||
} | ||
location /login { | ||
proxy_pass http://backendapi$uri$is_args$args; | ||
} | ||
location /logout { | ||
proxy_pass http://backendapi$uri$is_args$args; | ||
} | ||
location /api { | ||
proxy_pass http://backendapi$uri$is_args$args; | ||
} | ||
location /public { | ||
proxy_pass http://backendapi$uri$is_args$args; | ||
} | ||
location /pics { | ||
proxy_pass http://backendapi$uri$is_args$args; | ||
} | ||
location /images { | ||
proxy_pass http://backendapi$uri$is_args$args; | ||
} | ||
|
||
location /socket.io { | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-NginX-Proxy true; | ||
|
||
proxy_pass http://backendapi$uri$is_args$args; | ||
proxy_redirect off; | ||
|
||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection "upgrade"; | ||
} | ||
|
||
location / { | ||
include /etc/nginx/mime.types; | ||
try_files $uri $uri/ /index.html; | ||
index index.html index.html; | ||
} | ||
} | ||
} |