Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DataCatalog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eFlows4HPC WP2
DataCatalog
Commits
2a564226
Commit
2a564226
authored
3 years ago
by
Christian Boettcher
Browse files
Options
Downloads
Patches
Plain Diff
new and smaller dockerfile
parent
604d4b11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
apiserver/Dockerfile
+14
-10
14 additions, 10 deletions
apiserver/Dockerfile
with
15 additions
and
11 deletions
README.md
+
1
−
1
View file @
2a564226
...
...
@@ -98,7 +98,7 @@ while in the project root directory.
To run the docker image in a local container, run
```
bash
docker run
-d
--name
<container name>
-p
127.0.0.1:<local_port>:80 datacalog-apiserver
docker run
-d
--name
<container name>
-p
127.0.0.1:<local_port>:80
00
datacalog-apiserver
```
`<container name>`
is the name of your container, that can be used to refer to it with other docker commands.
...
...
This diff is collapsed.
Click to expand it.
apiserver/Dockerfile
+
14
−
10
View file @
2a564226
FROM
tiangolo/uvicorn-gunicorn:
python3.
8
FROM
python
:
3.
9-slim
LABEL
maintainer="Christian Böttcher <c.boettcher@fz-juelich.de>"
EXPOSE
8000
RUN
mkdir
-p
/app/data
RUN
mkdir
-p
/app/apiserver
RUN
apt update
&&
apt upgrade
-y
RUN
pip
install
--no-cache-dir
fastapi
RUN
pip
install
"fastapi==0.63.0"
\
"requests==2.25.1"
\
"uvicorn==0.13.4"
\
"python-dotenv==0.17.1"
\
"python-multipart==0.0.5"
\
"python-jose[cryptography]==3.2.0"
\
"passlib[bcrypt]==1.7.4"
ADD
. /app/apiserver
COPY
./config.env /app/apiserver/config.env
# This RUN creates a python file that contains the fastapi app, in a location that is expected by the base docker image
# This avoids naming conflicts with the packages in the project folder
RUN
echo
"from apiserver.main import app"
>
/app/main.py
# set data directory properly for the docker container
RUN
sed
-i
's_./app/data_/app/data_g'
/app/apiserver/config.env
\ No newline at end of file
RUN
sed
-i
's_./app/data_/app/data_g'
/app/apiserver/config.env
&&
sed
-i
's_./app/userdb.json_/app/userdb.json_g'
/app/apiserver/config.env
WORKDIR
/app
ENTRYPOINT
["uvicorn", "--host", "0.0.0.0", "apiserver:app"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Christian Boettcher
@boettcher1
mentioned in issue
#15 (closed)
·
3 years ago
mentioned in issue
#15 (closed)
mentioned in issue #15
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment