From 7e68b77a3ff5039cb156746b833511bdf54d3399 Mon Sep 17 00:00:00 2001 From: Maddy Guthridge Date: Thu, 17 Oct 2024 01:55:50 +1100 Subject: [PATCH 1/3] Update docker configs --- Dockerfile | 7 +++++-- docker-compose.yml | 22 +++++++++------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0475f61d..da1453ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,13 @@ FROM node:20 # Make volumes be owned by the node user -RUN mkdir /home/node/.ssh -RUN chown node:node /home/node/.ssh RUN mkdir /data RUN chown node:node /data +RUN mkdir /private_data +RUN chown node:node /private_data + +# Install Git and SSH +RUN apt install -y ssh git USER node diff --git a/docker-compose.yml b/docker-compose.yml index 00827e52..4b281011 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,41 +3,37 @@ # # Usage: # * The data directory will be set up inside `./data` on the host system +# * The private_data directory will be set up inside `./private_data` on the +# host system. # * You should create a `.env` file to contain the `AUTH_SECRET` environment # variable. Perhaps you could generate this using the command here: # https://unix.stackexchange.com/a/476125/161355 -# * TODO: To forward SSH host, some modification may be required (I will investigate -# this soon) # # It is not necessary to set up other environment variables services: minifolio: - # Uncomment these lines to build from the local repository, rather than the - # latest published version + # To build from the local repo, rather than the latest published version: + # Comment out this line + image: maddyguthridge/minifolio + # And uncomment these lines # build: # context: . # ssh: # - default - # And comment out this line - image: maddyguthridge/minifolio + hostname: minifolio restart: always ports: - 127.0.0.1:3000:3000/tcp volumes: - "./data:/data:rw" - # Forward local machine SSH key to docker - # Note: this may need changes on MacOS - # Source: https://stackoverflow.com/a/36648428/6335363 - - $SSH_AUTH_SOCK:/ssh-agent - - "ssh_dir:/home/node/.ssh:rw" + - "./private_data:/private_data:rw" environment: DATA_REPO_PATH: "/data" + PRIVATE_DATA_PATH: "/data" HOST: 0.0.0.0 PORT: 3000 - # Tell the container where to find the SSH auth socket - SSH_AUTH_SOCK: /ssh-agent # Set up `AUTH_SECRET` variable within `.env` env_file: ".env" volumes: From 3d7efcf9cb46ccc6a027db4842242eec49270c14 Mon Sep 17 00:00:00 2001 From: Maddy Guthridge Date: Thu, 17 Oct 2024 02:01:08 +1100 Subject: [PATCH 2/3] Actually test the docker commands :3 --- Dockerfile | 2 +- docker-compose.yml | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index da1453ed..115462f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ RUN mkdir /private_data RUN chown node:node /private_data # Install Git and SSH -RUN apt install -y ssh git +RUN apt install -y openssh-client git USER node diff --git a/docker-compose.yml b/docker-compose.yml index 4b281011..644bb3bf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,5 +36,3 @@ services: PORT: 3000 # Set up `AUTH_SECRET` variable within `.env` env_file: ".env" -volumes: - ssh_dir: From 4d32a4ee469e29ee5cb004b62342815eac0e345c Mon Sep 17 00:00:00 2001 From: Maddy Guthridge Date: Thu, 17 Oct 2024 02:02:54 +1100 Subject: [PATCH 3/3] Remove references to AUTH_SECRET environment variable --- docker-compose.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 644bb3bf..e2650359 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,11 +5,6 @@ # * The data directory will be set up inside `./data` on the host system # * The private_data directory will be set up inside `./private_data` on the # host system. -# * You should create a `.env` file to contain the `AUTH_SECRET` environment -# variable. Perhaps you could generate this using the command here: -# https://unix.stackexchange.com/a/476125/161355 -# -# It is not necessary to set up other environment variables services: minifolio: # To build from the local repo, rather than the latest published version: @@ -34,5 +29,3 @@ services: PRIVATE_DATA_PATH: "/data" HOST: 0.0.0.0 PORT: 3000 - # Set up `AUTH_SECRET` variable within `.env` - env_file: ".env"