Avoid exposing internal ports
This commit is contained in:
		
							parent
							
								
									95651ee942
								
							
						
					
					
						commit
						c2398c0d80
					
				| @ -38,5 +38,5 @@ COPY --from=build /rails /rails | ||||
| ENTRYPOINT ["/rails/bin/docker-entrypoint"] | ||||
| 
 | ||||
| # Start the server by default, this can be overwritten at runtime | ||||
| EXPOSE 3001 | ||||
| EXPOSE 3000 | ||||
| CMD ["./bin/rails", "server", "--binding=0.0.0.0"] | ||||
|  | ||||
| @ -4,17 +4,28 @@ services: | ||||
|       context: . | ||||
|       dockerfile: Dockerfile.dev | ||||
|     ports: | ||||
|       - "3001:3001" | ||||
|       - 3000 | ||||
|     depends_on: | ||||
|       - db | ||||
|       db: | ||||
|         condition: service_healthy | ||||
|     environment:  | ||||
|       DATABASE_URL: postgres://postgres:postgres@db:5432/postgres | ||||
|       RAILS_ENV: development | ||||
|   workers: | ||||
|     build: | ||||
|       context: . | ||||
|       dockerfile: Dockerfile.dev | ||||
|     entrypoint: bin/jobs | ||||
|     depends_on: | ||||
|       db: | ||||
|         condition: service_healthy | ||||
|     environment:  | ||||
|       DATABASE_URL: postgres://postgres:postgres@db:5432/postgres | ||||
|       RAILS_ENV: development | ||||
|       PORT: 3001 | ||||
|   frontend: | ||||
|     build: ../wedding-planner-frontend | ||||
|     ports: | ||||
|       - 3000:3000 | ||||
|       - 3000 | ||||
|     depends_on: | ||||
|       - backend | ||||
|   nginx: | ||||
| @ -34,5 +45,10 @@ services: | ||||
|       POSTGRES_USER: postgres | ||||
|       POSTGRES_PASSWORD: postgres | ||||
|       POSTGRES_DB: postgres | ||||
|     healthcheck: | ||||
|       test: ['CMD-SHELL', 'pg_isready -U postgres'] | ||||
|       interval: 10s | ||||
|       timeout: 5s | ||||
|       retries: 5 | ||||
| 
 | ||||
|     | ||||
| @ -3,7 +3,7 @@ server { | ||||
|     server_name libre-wedding-planner.app.localhost; | ||||
| 
 | ||||
|     location /api/ { | ||||
|         proxy_pass http://backend:3001/; | ||||
|         proxy_pass http://backend:3000/; | ||||
|         proxy_set_header Host $http_host; | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user