From bdcefb4fc8674ef1bc71f252974ef33d7c1362fb Mon Sep 17 00:00:00 2001 From: markoburcul Date: Tue, 13 Aug 2024 09:51:24 +0200 Subject: [PATCH] webcave: Move compose file to repo root Move compose file for webcave server to repo root since it is needed by the infra role with which we will deploy it. Updated the compose file to be compatible with environment variable forwarding from the ansible role. Namely, we need PORT, IS_BEHIND_PROXY and CLIENT_ORIGIN_URL to be read from environment of the process starting the containers. Also, in the case these values are not present or empty, just use the default ones. Update Readme file to reflect changes. Referenced issue: https://github.com/status-im/infra-misc/issues/308 Signed-off-by: markoburcul --- .gitignore | 4 +++- docker-compose.yml | 16 ++++++++++++++++ packages/webcave-server/.gitignore | 1 - packages/webcave-server/docker-compose.yml | 10 ---------- 4 files changed, 19 insertions(+), 12 deletions(-) create mode 100644 docker-compose.yml delete mode 100644 packages/webcave-server/.gitignore delete mode 100644 packages/webcave-server/docker-compose.yml diff --git a/.gitignore b/.gitignore index ca87680..6b429b6 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,6 @@ yarn-error.log* pnpm-debug.log* lerna-debug.log* -.env \ No newline at end of file +.env + +saved_world_data \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..519a96e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,16 @@ +services: + webcave_server: + container_name: "server" + build: + context: ./ + dockerfile: ./packages/webcave-server/Dockerfile + ports: + - ${PORT:-3001}:${PORT:-3001} + volumes: + - ./saved_world_data:/usr/src/app/packages/webcave-server/saved_world_data + environment: + - PORT=${PORT:-3001} + - CLIENT_ORIGIN_URL=${CLIENT_ORIGIN_URL} + - IS_BEHIND_PROXY=${IS_BEHIND_PROXY} + env_file: + - .env \ No newline at end of file diff --git a/packages/webcave-server/.gitignore b/packages/webcave-server/.gitignore deleted file mode 100644 index 1ff8ba7..0000000 --- a/packages/webcave-server/.gitignore +++ /dev/null @@ -1 +0,0 @@ -saved_world_data \ No newline at end of file diff --git a/packages/webcave-server/docker-compose.yml b/packages/webcave-server/docker-compose.yml deleted file mode 100644 index ff110d9..0000000 --- a/packages/webcave-server/docker-compose.yml +++ /dev/null @@ -1,10 +0,0 @@ -services: - webcave_server: - container_name: "server" - build: - context: ./../../ - dockerfile: ./packages/webcave-server/Dockerfile - ports: - - ${PORT}:${PORT} - volumes: - - ./saved_world_data:/usr/src/app/packages/webcave-server/saved_world_data \ No newline at end of file