-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a first version of Dockerfile and compose
issues: - pip installs into user home, which is on a volume. not good! - we install from pypi, we'd also want to install from git source at some point
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM python:3.11-slim | ||
# Create user, we need $HOME/.config | ||
RUN useradd --create-home --shell /bin/bash synapseadmin | ||
# Create app dir and switch context (irrelevant on pypi inst) | ||
RUN mkdir /synadm_app | ||
WORKDIR /synadm_app | ||
COPY . . | ||
|
||
WORKDIR /home/synapseadmin | ||
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 | ||
RUN pip install --upgrade pip && \ | ||
pip install --no-cache-dir synadm && \ | ||
chown -R synapseadmin:synapseadmin /home/synapseadmin && \ | ||
chmod -R 755 /home/synapseadmin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
services: | ||
synadm_app: | ||
build: . | ||
container_name: synadm | ||
image: synadm_image | ||
#volumes: | ||
# - ./home/synapseadmin:/home/synapseadmin | ||
stdin_open: true | ||
tty: true |