Skip to content

Commit

Permalink
refactor: use /venv instead of /app/venv
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsquest committed Mar 25, 2024
1 parent 1adb7d4 commit 5d28b2f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ RUN apk add --no-cache --virtual=build-dependencies \
python3 \
py3-tz \
py3-pip \
&& python -m venv /app/venv \
&& /app/venv/bin/pip install --no-cache-dir radicale==$VERSION passlib[bcrypt] \
&& python -m venv /venv \
&& /venv/bin/pip install --no-cache-dir radicale==$VERSION passlib[bcrypt] \
&& apk del --purge build-dependencies \
&& addgroup -g $BUILD_GID radicale \
&& adduser -D -s /bin/false -H -u $BUILD_UID -G radicale radicale \
Expand All @@ -58,4 +58,4 @@ EXPOSE 5232

COPY docker-entrypoint.sh /usr/local/bin
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["/app/venv/bin/radicale", "--config", "/config/config"]
CMD ["/venv/bin/radicale", "--config", "/config/config"]
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ "$(id -u)" = "0" ] && [ "$TAKE_FILE_OWNERSHIP" = "true" ]; then
fi

# Run radicale as the "radicale" user or any other command if provided
if [ "$(id -u)" = "0" ] && [ "$1" = "/app/venv/bin/radicale" ]; then
if [ "$(id -u)" = "0" ] && [ "$1" = "/venv/bin/radicale" ]; then
exec su-exec radicale "$@"
else
exec "$@"
Expand Down
2 changes: 1 addition & 1 deletion test_image_custom_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_port(host):
assert host.socket('tcp://0.0.0.0:5232').is_listening

def test_version(host):
assert host.check_output('/app/venv/bin/radicale --version') == '3.0.0'
assert host.check_output('/venv/bin/radicale --version') == '3.0.0'

def test_user(host):
user = 'radicale'
Expand Down
2 changes: 1 addition & 1 deletion test_image_prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_port(host):


def test_version(host):
assert host.check_output('/app/venv/bin/radicale --version') == '3.1.9'
assert host.check_output('/venv/bin/radicale --version') == '3.1.9'


def test_user(host):
Expand Down

0 comments on commit 5d28b2f

Please sign in to comment.