Skip to content

Commit

Permalink
Add dockerignore file
Browse files Browse the repository at this point in the history
  • Loading branch information
Saphyel committed Feb 12, 2023
1 parent 71e0d94 commit d2f92c9
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 18 deletions.
15 changes: 15 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
**/__pycache__/
*_cache/
.idea/
.env
.git/
.gitignore
.github/
.vscode/
**/bin
Dockerfile
.dockerignore
.coverage
LICENSE
README.md
snapcraft.yaml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/__pycache__/
build/
*.egg-info/
.env
Expand Down
40 changes: 23 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
FROM python:3.11

ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_ROOT_USER_ACTION=ignore
ENV PORT 80
EXPOSE $PORT

WORKDIR /app

COPY pyproject.toml /app/

RUN pip install .

COPY . /app

CMD uvicorn main:app --host 0.0.0.0 --port $PORT
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

ENV PIP_DISABLE_PIP_VERSION_CHECK=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_ROOT_USER_ACTION=ignore
ENV PORT 8080
EXPOSE $PORT

WORKDIR /app

COPY pyproject.toml /app/

RUN pip install .

COPY . /app

RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser

CMD uvicorn main:app --host 0.0.0.0 --port $PORT
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ docker build -t tasker .
### Run the project in windows

```commandline
docker run --rm --env-file .env -it -v ${PWD}:/app tasker bash
docker run --rm --env-file .env -p 80:80 -it -v ${PWD}:/app tasker bash
```

### Start testing
Expand Down

0 comments on commit d2f92c9

Please sign in to comment.