Skip to content

Commit

Permalink
fix expose and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliomartinelli committed Mar 7, 2024
1 parent 200b707 commit 2b1d9aa
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 9 deletions.
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,52 @@ configure o caminho do projeto node.js ./docker/.env.docker.local
NODEJS_VOLUMES_FILES=/home/user/my_project_nodejs
```

## SSL

## Histórico
configure o caminho de onde se encontra o certificado ./docker/.env.docker.local

```
NGINX_VOLUMES_NGINX_SSL_CERTS=/home/user/my_certs
```

Retire os comentarios ./docker-compose.yml

```
- "${NGINX_SSL_PORT}:443"
```

```
- "${NGINX_VOLUMES_NGINX_SSL_CERTS}:/etc/nginx/certs"
```

Retire os comentarios ./docker/nginx/nginx.conf

```
server {
listen 443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/certs/localhost.crt;
ssl_certificate_key /etc/nginx/certs/localhost.key;
location / {
proxy_pass http://nodejs;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
```



## Histórico
* 0.0.2
* correção portas e configuração correta expose das portas.
* suporte SSL nginx.
* 0.0.1
* Work in progress
* Inicio projeto.

## Meta

Expand Down
17 changes: 10 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
- ./docker/.env.docker.local
working_dir: /usr/src/app
ports:
- "${NODEJS_PORT}:${NODEJS_PORT}"
- "${NODEJS_PORT}:3000"
depends_on:
- mysql
- mongo
Expand All @@ -20,11 +20,14 @@ services:
nginx:
image: nginx:${NGINX_VERSION}
ports:
- "${NGINX_PORT}:${NGINX_PORT}"
- "${NGINX_SSL_PORT}:${NGINX_SSL_PORT}"
- "${NGINX_PORT}:80"
#- "${NGINX_SSL_PORT}:443"
expose:
- ${NGINX_PORT}
- ${NGINX_SSL_PORT}
volumes:
- "${NGINX_VOLUMES_NGINX_CONF}:/etc/nginx/nginx.conf"
- "${NGINX_VOLUMES_NGINX_SSL_CERTS}:/etc/nginx/certs"
#- "${NGINX_VOLUMES_NGINX_SSL_CERTS}:/etc/nginx/certs"
command: ["nginx", "-g", "daemon off;"]
depends_on:
- nodejs
Expand All @@ -41,7 +44,7 @@ services:
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
ports:
- "${MYSQL_PORT}:${MYSQL_PORT}"
- "${MYSQL_PORT}:3306"
expose:
- ${MYSQL_PORT}
volumes:
Expand All @@ -57,7 +60,7 @@ services:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD}
ports:
- "${MONGO_PORT}:${MONGO_PORT}"
- "${MONGO_PORT}:27017"
expose:
- ${MONGO_PORT}
volumes:
Expand All @@ -67,4 +70,4 @@ services:

volumes:
api-mysql:
api-mongo:
api-mongo:

0 comments on commit 2b1d9aa

Please sign in to comment.