Skip to content

Commit

Permalink
Merge pull request #24 from MaddyGuthridge/maddy-improve-docker-compose
Browse files Browse the repository at this point in the history
Update docker configs
  • Loading branch information
MaddyGuthridge authored Oct 16, 2024
2 parents dc3ee9b + 4d32a4e commit 64d8bcf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 openssh-client git

USER node

Expand Down
31 changes: 9 additions & 22 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,29 @@
#
# Usage:
# * The data directory will be set up inside `./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
# * The private_data directory will be set up inside `./private_data` on the
# host system.
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:
ssh_dir:

0 comments on commit 64d8bcf

Please sign in to comment.