Skip to content

Commit da2fca2

Browse files
authored
Merge pull request #48 from eScienceLab/docker-security
Docker security
2 parents f121879 + 5c55dcd commit da2fca2

3 files changed

Lines changed: 37 additions & 2 deletions

File tree

.dockerignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Git
2+
**/.git
3+
**/.github
4+
**/.gitignore
5+
**/.gitattributes
6+
7+
8+
# Environments
9+
example.env
10+
.env
11+
.venv
12+
env/
13+
venv/
14+
ENV/
15+
env.bak/
16+
venv.bak/
17+
18+
# OSX files
19+
**/.DS_Store
20+
21+
# Docker
22+
Dockerfile
23+
docker-compose*
24+
.dockerignore
25+
26+
# Python
27+
**/__pycache__

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ WORKDIR /app
77

88
COPY requirements.txt .
99
RUN pip install --upgrade pip
10-
RUN pip install roc-validator
1110
RUN pip install --no-cache-dir -r requirements.txt
1211

13-
COPY . .
12+
COPY cratey.py LICENSE /app/
13+
COPY app /app/app
14+
15+
RUN useradd -ms /bin/bash flaskuser
16+
RUN chown -R flaskuser:flaskuser /app
17+
18+
USER flaskuser
1419

1520
EXPOSE 5000
1621

1722
CMD ["flask", "run", "--host=0.0.0.0"]
23+
24+
LABEL org.opencontainers.image.source="https://github.com/eScienceLab/Cratey-Validator"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ Werkzeug~=3.0.4
66
redis~=5.2.0
77
python-dotenv~=1.0.1
88
apiflask~=2.4.0
9+
roc-validator~=0.6.5

0 commit comments

Comments
 (0)