-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a basic recipe to create an image of the app
- Loading branch information
1 parent
1f48c82
commit 22caca4
Showing
1 changed file
with
34 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This more like a (basic) recipe to smoke-test the app in a docker container | ||
# It is NOT the actual Dockerfile which is used in production at MoveApps. | ||
FROM condaforge/miniforge3:latest | ||
LABEL org.opencontainers.image.authors="[email protected]" | ||
LABEL org.opencontainers.image.vendor="couchbits GmbH" | ||
|
||
# if you need to install any OS libraries use the following snippet | ||
# USER root | ||
# RUN apt-get update \ | ||
# && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
# # install qgis | ||
# lib-a lib-b \ | ||
# ./en os-lib install snippet | ||
|
||
# create working dir | ||
ENV PROJECT_DIR=/opt/co-pilot-python | ||
ENV ENV_PREFIX=$PROJECT_DIR/conda | ||
RUN mkdir $PROJECT_DIR | ||
|
||
# Security Aspects | ||
ENV UID=moveapps | ||
ENV GID=moveapps | ||
RUN addgroup --system $GID && adduser --system $UID --ingroup $GID | ||
RUN chown $UID:$GID $PROJECT_DIR | ||
|
||
USER $UID:$GID | ||
WORKDIR $PROJECT_DIR | ||
|
||
# setup runtime environment | ||
COPY --chown=$UID:$GID . $PROJECT_DIR | ||
RUN conda env create --prefix $ENV_PREFIX --file $PROJECT_DIR/environment.yml && \ | ||
conda clean --all --yes | ||
|
||
ENTRYPOINT [ "conda", "run", "--prefix", "${ENV_PREFIX}", "python3", "sdk.py" ] |