From b1cfeea4c331583c31e0073afed4ea38dc623df9 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Fri, 10 Jan 2025 08:13:36 -0500 Subject: [PATCH] chore: move compose.yml to its own directory --- compose.yml | 18 ------------------ compose/compose.yml | 16 ++++++++++++++++ proxy/Dockerfile | 3 +++ proxy/{proxy.conf.template => proxy.conf} | 0 4 files changed, 19 insertions(+), 18 deletions(-) delete mode 100644 compose.yml create mode 100644 compose/compose.yml rename proxy/{proxy.conf.template => proxy.conf} (100%) diff --git a/compose.yml b/compose.yml deleted file mode 100644 index a645d78..0000000 --- a/compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: code-containers - -services: - server: - build: . - ports: - - 3000:3000 - volumes: - - /var/run/docker.sock:/var/run/docker.sock:ro - proxy: - build: proxy - env_file: .env - ports: - - 80:80 - volumes: - - ./proxy/proxy.conf.template:/etc/nginx/conf.d/proxy.conf.template - network_mode: host - command: /bin/sh -c "sed 's/{PROXY_DOMAIN}/$PROXY_DOMAIN/' /etc/nginx/conf.d/proxy.conf.template > /etc/nginx/conf.d/proxy.conf && nginx -g 'daemon off;'" diff --git a/compose/compose.yml b/compose/compose.yml new file mode 100644 index 0000000..64e32b1 --- /dev/null +++ b/compose/compose.yml @@ -0,0 +1,16 @@ +name: code-containers + +services: + server: + build: .. + env_file: ../.env + ports: + - 3000:3000 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + proxy: + build: ../proxy + env_file: ../.env + ports: + - 80:80 + network_mode: host diff --git a/proxy/Dockerfile b/proxy/Dockerfile index a0f8e37..d08a441 100644 --- a/proxy/Dockerfile +++ b/proxy/Dockerfile @@ -3,3 +3,6 @@ FROM openresty/openresty:alpine RUN wget -O /usr/local/openresty/lualib/resty/http.lua https://github.com/ledgetech/lua-resty-http/raw/refs/heads/master/lib/resty/http.lua RUN wget -O /usr/local/openresty/lualib/resty/http_connect.lua https://github.com/ledgetech/lua-resty-http/raw/refs/heads/master/lib/resty/http_connect.lua RUN wget -O /usr/local/openresty/lualib/resty/http_headers.lua https://github.com/ledgetech/lua-resty-http/raw/refs/heads/master/lib/resty/http_headers.lua + +COPY proxy.conf etc/nginx/conf.d/proxy.conf +ENTRYPOINT ["/bin/sh", "-c", "sed -i \"s/{PROXY_DOMAIN}/$PROXY_DOMAIN/\" etc/nginx/conf.d/proxy.conf && nginx -g 'daemon off;'"] diff --git a/proxy/proxy.conf.template b/proxy/proxy.conf similarity index 100% rename from proxy/proxy.conf.template rename to proxy/proxy.conf