generated from ghga-de/microservice-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
|
||
scripts/script_utils/fastapi_app_location.py | ||
|
||
Dockerfile | ||
config_schema.json | ||
example_config.yaml | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2021 - 2024 Universität Tübingen, DKFZ, EMBL, and Universität zu Köln | ||
# for the German Human Genome-Phenome Archive (GHGA) | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# BASE: a base image with updated packages | ||
FROM python:3.12-alpine AS base | ||
RUN apk upgrade --no-cache --available | ||
|
||
# BUILDER: a container to build the service wheel | ||
FROM base AS builder | ||
RUN pip install build | ||
COPY . /service | ||
WORKDIR /service | ||
RUN python -m build | ||
|
||
# DEP-BUILDER: a container to (build and) install dependencies | ||
FROM base AS dep-builder | ||
RUN apk update | ||
RUN apk add build-base gcc g++ libffi-dev zlib-dev | ||
RUN apk upgrade --available | ||
WORKDIR /service | ||
COPY --from=builder /service/lock/requirements.txt /service | ||
RUN pip install --no-deps -r requirements.txt | ||
|
||
# RUNNER: a container to run the service | ||
FROM base AS runner | ||
WORKDIR /service | ||
RUN rm -rf /usr/local/lib/python3.12 | ||
COPY --from=dep-builder /usr/local/lib/python3.12 /usr/local/lib/python3.12 | ||
COPY --from=builder /service/dist/ /service | ||
RUN pip install --no-deps *.whl | ||
RUN rm *.whl | ||
RUN adduser -D appuser | ||
WORKDIR /home/appuser | ||
USER appuser | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# Please adapt to package name: | ||
ENTRYPOINT ["metldata"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters