Skip to content
Snippets Groups Projects
Commit ad935da9 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Merge branch 'use-compose' into 'main'

how to run with compose in prod

See merge request !4
parents 3ee429c4 ffe79abe
Branches
Tags
1 merge request!4how to run with compose in prod
Pipeline #132521 skipped
...@@ -3,8 +3,8 @@ image: docker:24 ...@@ -3,8 +3,8 @@ image: docker:24
build: build:
except: rules:
- main - if: '$CI_COMMIT_REF_SLUG =~ /^base-/i'
stage: build stage: build
needs: [] needs: []
before_script: before_script:
......
DEPLOY_USER=my-user
DEPLOY_TOKEN=not-secured-password
\ No newline at end of file
CI_PROJECT_NAMESPACE=ada-team
CI_PROJECT_NAME=my-project
CI_REGISTRY=registry-gitlab.pasteur.fr
PROD_BRANCH=main
CI_PROJECT_NAMESPACE=hub
CI_PROJECT_NAME=shiny-k8s-example
CI_REGISTRY=registry-gitlab.pasteur.fr
PROD_BRANCH=base-python
# Running in production with docker compose
Documentation can be found at https://hub.pages.pasteur.fr/shiny-k8s/user_guide/run_with_compose.html
## Configure your .env
In the `.env` file we provide example to run the compose :
Given a project hosted at # If your project is hosted at https://gitlab.pasteur.fr/ada-team/my-project/
where the production branch is named `main`, the file is:
```ini
CI_PROJECT_NAMESPACE=ada-team
CI_PROJECT_NAME=my-project
CI_REGISTRY=registry-gitlab.pasteur.fr
PROD_BRANCH=main
```
## Run it
```sh
docker compose up -d
```
## Run the example
```sh
docker compose --env-file .example.env up
```
## With private registry
You have to auth before starting the compose. Given a .auth file containing :
```ini
DEPLOY_USER=my-user
DEPLOY_TOKEN=not-secured-password
```
You should then do:
```sh
source .auth
source .env
echo $DEPLOY_TOKEN | docker login --username $DEPLOY_USER $CI_REGISTRY --password-stdin
docker compose up -d
```
more info can be found at https://docs.docker.com/reference/cli/docker/login/#password-stdin
\ No newline at end of file
services:
shiny-server:
image: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}/${PROD_BRANCH}:latest
pull_policy: always
user: 'shiny:shiny'
volumes:
- ./logs:/var/log/shiny-server
- ./persistent:/srv/shiny-server/www/persistent
- ./data:/srv/shiny-server/data:ro
ports:
- '3838:3838'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment