Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
fb57ae23
Commit
fb57ae23
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
add an entrypoint for running the db migrations in runtime
parent
d483ea74
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!90
include TRANSLATIONS_DIR as environment variable in the Docker image
Pipeline
#84407
passed
1 year ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Dockerfile
+6
-13
6 additions, 13 deletions
Dockerfile
entrypoint.sh
+14
-0
14 additions, 0 deletions
entrypoint.sh
with
20 additions
and
13 deletions
Dockerfile
+
6
−
13
View file @
fb57ae23
...
...
@@ -17,22 +17,15 @@ RUN pip install \
# NOTE: a real config must be mounted at /etc/gso/config.json when running the container
RUN
mkdir
-p
/etc/gso
&&
\
chown
-R
appuser:appgroup /etc/gso
COPY
--chown=appuser:appgroup gso/oss-params-example.json /etc/gso/config.json
# Expose port 8080 for the FastAPI application
EXPOSE
8080
COPY
--chown=appuser:appgroup gso/oss-params-example.json /app/config.json
# The app reads the configuration from this location.
# No need to set environment variables in your docker-compose.
ENV
OSS_PARAMS_FILENAME=/
etc/gso
/config.json
ENV
OSS_PARAMS_FILENAME=/
app
/config.json
# Set the environment variable for the translations directory
ENV
TRANSLATIONS_DIR=/app/gso/translations/
# Run database migrations
RUN
mv
gso/migrations gso/migrations_temp
RUN
PYTHONPATH
=
.
python gso/main.py db init
RUN
rm
-rf
gso/migrations
&&
\
mv
gso/migrations_temp gso/migrations
RUN
PYTHONPATH
=
.
python gso/main.py db upgrade heads
# Start the FastAPI application
CMD
["python", "-m", "uvicorn", "gso.main:app", "--host", "0.0.0.0", "--port", "8080"]
COPY
--chown=appuser:appgroup --chmod=755 entrypoint.sh /app/entrypoint.sh
EXPOSE
8080
ENTRYPOINT
["/app/entrypoint.sh"]
This diff is collapsed.
Click to expand it.
entrypoint.sh
0 → 100755
+
14
−
0
View file @
fb57ae23
#!/bin/sh
# Run database migrations
cd
gso
||
exit
1
mv
migrations migrations_temp
&&
\
PYTHONPATH
=
.. python main.py db init
&&
\
rm
-rf
migrations
&&
\
mv
migrations_temp migrations
PYTHONPATH
=
.. python main.py db upgrade heads
# Start the FastAPI application
cd
..
python
-m
uvicorn
"gso.main:app"
--host
"0.0.0.0"
--port
8080
This diff is collapsed.
Click to expand it.
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