Skip to content

Commit

Permalink
Fix volume wipe, remove chown,chmod
Browse files Browse the repository at this point in the history
- Declaring the home volume in compose only, fixes the wiping. Removed
  from Dockerfile. In compose it's defined so it uses the host's default
  volumes location.
- Changing owner,permissions is not required anymore since we now
  install as root to /usr/bin.
- Also stating ENV is not required anymore, /usr/bin in PATH already.
  • Loading branch information
JOJ0 committed Aug 17, 2024
1 parent 446acca commit 8e17777
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,10 @@ RUN \
chown -R synapseadmin:synapseadmin /home/synapseadmin && \
chmod -R 755 /home/synapseadmin
# User home on volume (will be prepoluated on first init)
VOLUME /home/synapseadmin
# Run as non-root user from here
USER synapseadmin
# Add user bin to path
ENV PATH="/home/synapseadmin/.local/bin:$PATH"
# Install synadm from pypi
# VOLUME /home/synapseadmin
# Install synadm from pypi to /usr/bin/synadm
RUN pip install --upgrade pip && \
pip install --no-cache-dir synadm && \
chown -R synapseadmin:synapseadmin /home/synapseadmin && \
chmod -R 755 /home/synapseadmin
pip install --no-cache-dir --root-user-action ignore synadm

# Run as non-root user from here
USER synapseadmin
9 changes: 7 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ services:
build: .
container_name: synadm
image: synadm_image
#volumes:
# - ./home/synapseadmin:/home/synapseadmin
volumes:
- adminhome:/home/synapseadmin
stdin_open: true
tty: true

# home directory volume to host default volumes location
volumes:
adminhome:

0 comments on commit 8e17777

Please sign in to comment.