Skip to content

Commit

Permalink
Merge pull request #12 from esune/fix/image-permissions
Browse files Browse the repository at this point in the history
Fix permissions in service image, added .dockerignore
  • Loading branch information
amanji authored Oct 22, 2024
2 parents fe66e2a + 55050d6 commit f14d721
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.devcontainer
.github
.vscode
docker
11 changes: 10 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
FROM python:3.12
FROM python:3.12-slim

# Create unprivileged user and group for service
RUN addgroup vcservice
RUN useradd -g vcservice vcservice

WORKDIR /app

# make user owner of app folder
RUN chown -R vcservice:vcservice /app

RUN pip install --no-cache-dir --upgrade pip
RUN pip install poetry

Expand All @@ -12,4 +19,6 @@ RUN poetry install --no-root --only main

COPY ../ ./

USER vcservice

CMD ["fastapi", "run", "main.py", "--port", "8080", "--proxy-headers"]

0 comments on commit f14d721

Please sign in to comment.