Skip to content

Commit dc930db

Browse files
committed
Fix docker-compose command and add nginx config
1 parent eb6ac81 commit dc930db

3 files changed

Lines changed: 29 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: '3.9'
2+
3+
services:
4+
api_server:
5+
build:
6+
dockerfile: ./Dockerfile
7+
command: /app/ml_rest_api/app.py
8+
expose:
9+
- 8888
10+
nginx:
11+
build: ./nginx
12+
ports:
13+
- 8888:8888
14+
depends_on:
15+
- api_server

nginx/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM nginx:stable-alpine
2+
3+
RUN rm /etc/nginx/conf.d/default.conf
4+
COPY ./nginx.conf /etc/nginx/conf.d

nginx/nginx.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
server {
2+
listen 8888;
3+
location / {
4+
proxy_pass http://api_server:8888;
5+
proxy_set_header Host $host;
6+
proxy_set_header X-Real-IP $remote_addr;
7+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
8+
proxy_redirect off;
9+
}
10+
}

0 commit comments

Comments
 (0)