Skip to content

Commit

Permalink
Test: CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
tongxuanbao committed Jan 10, 2024
1 parent cf3e549 commit 2431138
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
FROM nginx:alpine
FROM nginx:alpine AS base
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf

FROM base as development
COPY nginx-dev.conf /etc/nginx/conf.d/default.conf

FROM base
COPY nginx.conf /etc/nginx/conf.d/default.conf
1 change: 1 addition & 0 deletions docker-compose.development.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile
target: development
depends_on:
delivery:
condition: service_healthy
Expand Down
35 changes: 35 additions & 0 deletions nginx-dev.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
server {
listen 80;
server_name delivery.baotong.dev www.delivery.baotong.dev localhost;

location / {
proxy_pass http://simulator:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

location /delivery/ {
proxy_pass http://delivery:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

location /order/ {
proxy_pass http://order:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

location /restaurant/ {
proxy_pass http://restaurant:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}

location /user/ {
proxy_pass http://user:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}

2 changes: 1 addition & 1 deletion simulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func main() {
})

http.HandleFunc("/clicked", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Clicked")
fmt.Fprintf(w, "<button>Clicked</button>")
})

dir := http.Dir("./static")
Expand Down

0 comments on commit 2431138

Please sign in to comment.