From 8aa0b0ce8843f2407e3f1726198b1c2ea4b9afee Mon Sep 17 00:00:00 2001 From: Juncheol Cho Date: Wed, 8 Jul 2020 01:20:45 +0900 Subject: [PATCH] init --- .gitignore | 1 + Dockerfile | 2 ++ Makefile | 13 +++++++++++++ docker-compose.yaml | 9 +++++++++ templates/default.conf.template | 8 ++++++++ 5 files changed, 33 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 docker-compose.yaml create mode 100644 templates/default.conf.template diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e67b74 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +app.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..49a8e92 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,2 @@ +FROM nginx:1.19.0-alpine +COPY ./templates /etc/nginx/templates diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..89e5ad9 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +name := s3-proxy + +build: + @docker build . -t ${name} + +sh: + @docker run --rm -it ${name} sh + +up: + @docker-compose up + +down: + @docker-compose down diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..9223474 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +version: "3.7" + +services: + proxy: + image: s3-proxy + ports: + - 8080:80 + env_file: + - app.env diff --git a/templates/default.conf.template b/templates/default.conf.template new file mode 100644 index 0000000..1ab87c2 --- /dev/null +++ b/templates/default.conf.template @@ -0,0 +1,8 @@ +server { + listen 80; + charset utf-8; + + location / { + proxy_pass http://${AWS_BUCKET}.s3.amazonaws.com; + } +} \ No newline at end of file