mirror of
https://github.com/penpot/penpot.git
synced 2025-05-24 14:37:15 +02:00
🔥 Remove backend-only devenv container
(disable requirement of using cors and secure cookies in devenv)
This commit is contained in:
parent
7560e32911
commit
c4939c152d
4 changed files with 5 additions and 90 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
export PENPOT_HOST=devenv
|
export PENPOT_HOST=devenv
|
||||||
export PENPOT_TENANT=dev
|
export PENPOT_TENANT=dev
|
||||||
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-cors enable-transit-readable-response enable-demo-users"
|
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-transit-readable-response enable-demo-users disable-secure-session-cookies"
|
||||||
|
|
||||||
# export PENPOT_DATABASE_URI="postgresql://172.17.0.1:5432/penpot"
|
# export PENPOT_DATABASE_URI="postgresql://172.17.0.1:5432/penpot"
|
||||||
# export PENPOT_DATABASE_USERNAME="penpot"
|
# export PENPOT_DATABASE_USERNAME="penpot"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
export PENPOT_HOST=devenv
|
export PENPOT_HOST=devenv
|
||||||
export PENPOT_TENANT=dev
|
export PENPOT_TENANT=dev
|
||||||
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-cors enable-transit-readable-response enable-demo-users disable-secure-session-cookies"
|
export PENPOT_FLAGS="$PENPOT_FLAGS enable-backend-asserts enable-audit-log enable-transit-readable-response enable-demo-users disable-secure-session-cookies"
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ volumes:
|
||||||
|
|
||||||
services:
|
services:
|
||||||
main:
|
main:
|
||||||
profiles: ["full"]
|
|
||||||
privileged: true
|
privileged: true
|
||||||
image: "penpotapp/devenv:latest"
|
image: "penpotapp/devenv:latest"
|
||||||
build:
|
build:
|
||||||
|
@ -67,7 +66,6 @@ services:
|
||||||
- PENPOT_LDAP_ATTRS_PHOTO=jpegPhoto
|
- PENPOT_LDAP_ATTRS_PHOTO=jpegPhoto
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
profiles: ["full"]
|
|
||||||
image: "minio/minio:latest"
|
image: "minio/minio:latest"
|
||||||
command: minio server /mnt/data --console-address ":9001"
|
command: minio server /mnt/data --console-address ":9001"
|
||||||
|
|
||||||
|
@ -82,56 +80,6 @@ services:
|
||||||
- 9000:9000
|
- 9000:9000
|
||||||
- 9001:9001
|
- 9001:9001
|
||||||
|
|
||||||
backend:
|
|
||||||
profiles: ["backend"]
|
|
||||||
privileged: true
|
|
||||||
image: "penpotapp/devenv:latest"
|
|
||||||
build:
|
|
||||||
context: "."
|
|
||||||
container_name: "penpot-backend"
|
|
||||||
stop_signal: SIGINT
|
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- postgres
|
|
||||||
- redis
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
- "user_data:/home/penpot/"
|
|
||||||
- "${PWD}:/home/penpot/penpot:z"
|
|
||||||
|
|
||||||
ports:
|
|
||||||
- 6060:6060
|
|
||||||
- 6061:6061
|
|
||||||
- 9090:9090
|
|
||||||
|
|
||||||
environment:
|
|
||||||
- EXTERNAL_UID=${CURRENT_USER_ID}
|
|
||||||
- PENPOT_SECRET_KEY=super-secret-devenv-key
|
|
||||||
|
|
||||||
# SMTP setup
|
|
||||||
- PENPOT_SMTP_ENABLED=true
|
|
||||||
- PENPOT_SMTP_DEFAULT_FROM=no-reply@example.com
|
|
||||||
- PENPOT_SMTP_DEFAULT_REPLY_TO=no-reply@example.com
|
|
||||||
- PENPOT_SMTP_HOST=mailer
|
|
||||||
- PENPOT_SMTP_PORT=1025
|
|
||||||
- PENPOT_SMTP_USERNAME=
|
|
||||||
- PENPOT_SMTP_PASSWORD=
|
|
||||||
- PENPOT_SMTP_SSL=false
|
|
||||||
- PENPOT_SMTP_TLS=false
|
|
||||||
|
|
||||||
# LDAP setup
|
|
||||||
- PENPOT_LDAP_HOST=ldap
|
|
||||||
- PENPOT_LDAP_PORT=10389
|
|
||||||
- PENPOT_LDAP_SSL=false
|
|
||||||
- PENPOT_LDAP_STARTTLS=false
|
|
||||||
- PENPOT_LDAP_BASE_DN=ou=people,dc=planetexpress,dc=com
|
|
||||||
- PENPOT_LDAP_BIND_DN=cn=admin,dc=planetexpress,dc=com
|
|
||||||
- PENPOT_LDAP_BIND_PASSWORD=GoodNewsEveryone
|
|
||||||
- PENPOT_LDAP_ATTRS_USERNAME=uid
|
|
||||||
- PENPOT_LDAP_ATTRS_EMAIL=mail
|
|
||||||
- PENPOT_LDAP_ATTRS_FULLNAME=cn
|
|
||||||
- PENPOT_LDAP_ATTRS_PHOTO=jpegPhoto
|
|
||||||
|
|
||||||
# keycloak:
|
# keycloak:
|
||||||
# image: "quay.io/keycloak/keycloak:15.0.2"
|
# image: "quay.io/keycloak/keycloak:15.0.2"
|
||||||
# environment:
|
# environment:
|
||||||
|
|
39
manage.sh
39
manage.sh
|
@ -45,31 +45,15 @@ function pull-devenv-if-not-exists {
|
||||||
function start-devenv {
|
function start-devenv {
|
||||||
pull-devenv-if-not-exists $@;
|
pull-devenv-if-not-exists $@;
|
||||||
|
|
||||||
# Check if the "backend-only" container is running. If it is, we need tot stop it first
|
docker compose -p $DEVENV_PNAME -f docker/devenv/docker-compose.yaml up -d;
|
||||||
if [[ ! $(docker ps -f "name=penpot-backend" -q) ]]; then
|
|
||||||
docker compose -p $DEVENV_PNAME --profile backend -f docker/devenv/docker-compose.yaml stop -t 2 backend;
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker compose -p $DEVENV_PNAME --profile full -f docker/devenv/docker-compose.yaml up -d;
|
|
||||||
}
|
|
||||||
|
|
||||||
function start-backend {
|
|
||||||
pull-devenv-if-not-exists $@;
|
|
||||||
|
|
||||||
# Check if the "devenv" container is running. If it is, we need tot stop it first because conflicts with the backend
|
|
||||||
if [[ ! $(docker ps -f "name=penpot-devenv-main" -q) ]]; then
|
|
||||||
docker compose -p $DEVENV_PNAME --profile full -f docker/devenv/docker-compose.yaml stop -t 2 main;
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker compose -p $DEVENV_PNAME --profile backend -f docker/devenv/docker-compose.yaml up -d;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function stop-devenv {
|
function stop-devenv {
|
||||||
docker compose -p $DEVENV_PNAME --profile full --profile backend -f docker/devenv/docker-compose.yaml stop -t 2;
|
docker compose -p $DEVENV_PNAME -f docker/devenv/docker-compose.yaml stop -t 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
function drop-devenv {
|
function drop-devenv {
|
||||||
docker compose -p $DEVENV_PNAME --profile full --profile backend -f docker/devenv/docker-compose.yaml down -t 2 -v;
|
docker compose -p $DEVENV_PNAME -f docker/devenv/docker-compose.yaml down -t 2 -v;
|
||||||
|
|
||||||
echo "Clean old development image $DEVENV_IMGNAME..."
|
echo "Clean old development image $DEVENV_IMGNAME..."
|
||||||
docker images $DEVENV_IMGNAME -q | awk '{print $3}' | xargs --no-run-if-empty docker rmi
|
docker images $DEVENV_IMGNAME -q | awk '{print $3}' | xargs --no-run-if-empty docker rmi
|
||||||
|
@ -87,14 +71,6 @@ function run-devenv {
|
||||||
docker exec -ti penpot-devenv-main sudo -EH -u penpot /home/start-tmux.sh
|
docker exec -ti penpot-devenv-main sudo -EH -u penpot /home/start-tmux.sh
|
||||||
}
|
}
|
||||||
|
|
||||||
function run-backend {
|
|
||||||
if [[ ! $(docker ps -f "name=penpot-backend" -q) ]]; then
|
|
||||||
start-backend
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker exec -ti penpot-backend sudo -EH -u penpot /home/start-tmux-back.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
function build {
|
function build {
|
||||||
echo ">> build start: $1"
|
echo ">> build start: $1"
|
||||||
local version=$(print-current-version);
|
local version=$(print-current-version);
|
||||||
|
@ -200,9 +176,6 @@ function usage {
|
||||||
echo "- stop-devenv Stops the development oriented docker compose service."
|
echo "- stop-devenv Stops the development oriented docker compose service."
|
||||||
echo "- drop-devenv Remove the development oriented docker compose containers, volumes and clean images."
|
echo "- drop-devenv Remove the development oriented docker compose containers, volumes and clean images."
|
||||||
echo "- run-devenv Attaches to the running devenv container and starts development environment"
|
echo "- run-devenv Attaches to the running devenv container and starts development environment"
|
||||||
echo "- start-backend Start the backend only service."
|
|
||||||
echo "- run-backend Starts a backend-only instance and attach tmux to it"
|
|
||||||
echo " based on tmux (frontend at localhost:3449, backend at localhost:6060)."
|
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,15 +200,9 @@ case $1 in
|
||||||
start-devenv)
|
start-devenv)
|
||||||
start-devenv ${@:2}
|
start-devenv ${@:2}
|
||||||
;;
|
;;
|
||||||
start-backend)
|
|
||||||
start-backend ${@:2}
|
|
||||||
;;
|
|
||||||
run-devenv)
|
run-devenv)
|
||||||
run-devenv ${@:2}
|
run-devenv ${@:2}
|
||||||
;;
|
;;
|
||||||
run-backend)
|
|
||||||
run-backend ${@:2}
|
|
||||||
;;
|
|
||||||
stop-devenv)
|
stop-devenv)
|
||||||
stop-devenv ${@:2}
|
stop-devenv ${@:2}
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue