diff --git a/Makefile b/Makefile index abd514e..526aaf3 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS := cmd/app cmd/nginx cmd/ytdl +SUBDIRS := cmd/api cmd/nginx cmd/ytdl GOLANGCI := ./bin/golangci-lint .PHONY: push diff --git a/cmd/api/.gitignore b/cmd/api/.gitignore new file mode 100644 index 0000000..9e5bfb4 --- /dev/null +++ b/cmd/api/.gitignore @@ -0,0 +1 @@ +api \ No newline at end of file diff --git a/cmd/app/Dockerfile b/cmd/api/Dockerfile similarity index 57% rename from cmd/app/Dockerfile rename to cmd/api/Dockerfile index defbaa0..4fc4397 100644 --- a/cmd/app/Dockerfile +++ b/cmd/api/Dockerfile @@ -1,4 +1,4 @@ FROM alpine RUN apk --update --no-cache add ca-certificates -COPY ./server /server -ENTRYPOINT ["/server"] \ No newline at end of file +COPY ./api /api +ENTRYPOINT ["/api"] \ No newline at end of file diff --git a/cmd/app/Makefile b/cmd/api/Makefile similarity index 64% rename from cmd/app/Makefile rename to cmd/api/Makefile index 4d04c51..0203a32 100644 --- a/cmd/app/Makefile +++ b/cmd/api/Makefile @@ -1,4 +1,4 @@ -OUT := server +OUT := api SRC := $(wildcard *.go) build: $(SRC) @@ -6,8 +6,8 @@ build: $(SRC) .PHONY: push push: build - docker build -t mxpv/podsync . - docker push mxpv/podsync + docker build -t mxpv/podsync_api . + docker push mxpv/podsync_api .PHONY: clean clean: diff --git a/cmd/app/main.go b/cmd/api/main.go similarity index 100% rename from cmd/app/main.go rename to cmd/api/main.go diff --git a/cmd/app/.gitignore b/cmd/app/.gitignore deleted file mode 100644 index 13cd1fa..0000000 --- a/cmd/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -server \ No newline at end of file diff --git a/cmd/nginx/podsync.conf b/cmd/nginx/podsync.conf index eb9071a..96f8a93 100644 --- a/cmd/nginx/podsync.conf +++ b/cmd/nginx/podsync.conf @@ -3,7 +3,7 @@ upstream worker { } upstream backend { - server app:5001; + server api:5001; } proxy_cache_path /tmp/nginx levels=1:2 keys_zone=feeds_cache:25m max_size=1g inactive=30m use_temp_path=off; diff --git a/docker-compose.yml b/docker-compose.yml index 6ee04ef..2222063 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ version: '2.1' services: - app: - image: mxpv/podsync - container_name: app + api: + image: mxpv/podsync_api + container_name: api restart: always ports: - 5001 @@ -35,7 +35,7 @@ services: ports: - 5002 environment: - - METADATA_URL=http://app:5001/api/metadata/{feed_id} + - METADATA_URL=http://api:5001/api/metadata/{feed_id} nginx: image: mxpv/nginx:latest container_name: nginx