diff --git a/build/api/Dockerfile.dev b/build/api/Dockerfile.dev index 2a0af66..3e30b35 100644 --- a/build/api/Dockerfile.dev +++ b/build/api/Dockerfile.dev @@ -7,7 +7,7 @@ ENV GO111MODULE on WORKDIR /go/src/app RUN apk update && \ - apk add git + apk add --no-cache git # Copy go.mod and go.sum COPY app/go.* ./ diff --git a/docker-compose.yaml b/docker-compose.yaml index c109a5c..ace6ff6 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -49,5 +49,21 @@ services: volume: nocopy: true + proxy: + image: nginx:1.25.1 + container_name: proxy + volumes: + - type: bind + source: ./nginx/nginx.conf + target: /etc/nginx/conf.d/default.conf + read_only: true + ports: + - target: 80 + published: 80 + protocol: TCP + mode: host + depends_on: + - api + volumes: db-data: diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..08abd84 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,8 @@ +server { + listen 80; + server_name localhost; + location / { + proxy_pass http://api:8080; + proxy_http_version 1.1; + } +}