Skip to content

Commit 0f5c531

Browse files
committed
Some devops updates
1 parent 9be1e73 commit 0f5c531

4 files changed

Lines changed: 11 additions & 41 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ENV NODE_OPTIONS="--max_old_space_size=4096"
2424
# Listen / accept connections from all IP addresses.
2525
# NOTE: At this time it is only possible to run Docker container in Production mode
2626
# if you have a public URL. See https://github.com/DSpace/dspace-angular/issues/1485
27-
ENV NODE_ENV=development
27+
ENV NODE_ENV=production
2828
RUN apk add tzdata
2929
RUN yarn build:prod
3030
RUN npm install pm2 -g

build-scripts/run/cleanup-db-duplicates.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,4 @@ WHERE ctid NOT IN (
2121
2222
-- Verify cleanup
2323
SELECT COUNT(*) as total_records FROM EPersonGroup2EPerson;
24-
SELECT COUNT(*) as unique_pairs FROM (
25-
SELECT DISTINCT eperson_group_id, eperson_id
26-
FROM EPersonGroup2EPerson
27-
) t;
28-
"
29-
30-
echo "Executing duplicate cleanup..."
31-
docker exec $DDBNAME /bin/bash -c "psql -p 10563 -U dspace -d dspace -c \"$CLEANUP_SQL\""
32-
33-
if [ $? -eq 0 ]; then
34-
echo "Database cleanup completed successfully"
35-
else
36-
echo "Database cleanup failed"
37-
exit 1
38-
fi
24+
SELECT COUNT(DISTINCT eperson_group_id, eperson_id) as unique_pairs FROM EPersonGroup2EPerson;

build-scripts/run/start.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ echo "====="
2727
#docker compose --env-file $ENVFILE -p $PROJECT -f docker/matomo-w-db.yml pull
2828
#docker compose --env-file $ENVFILE -p $PROJECT -f docker/matomo-w-db.yml up -d --no-build
2929

30+
# Ensure CLI container uses the same project network
31+
export COMPOSE_PROJECT_NAME=$PROJECT
32+
3033
# docker-compose-rest.yml must be last, since it specifies network in more detail. If it is not last, there is "root must be a mapping" error.
34+
echo "Creating administrator user..."
3135
docker compose --env-file $ENVFILE -p $PROJECT -f docker/docker-compose.yml -f docker/cli.yml -f docker/docker-compose-rest.yml run --rm dspace-cli create-administrator -e test@test.edu -f admin -l user -p admin -c en -o dataquest
36+
37+
echo "Creating regular user..."
3238
docker compose --env-file $ENVFILE -p $PROJECT -f docker/docker-compose.yml -f docker/cli.yml -f docker/docker-compose-rest.yml run --rm dspace-cli user --add -m user@test.edu -g meno -s priezvisko -l en -p user -o dataquest
39+
40+
echo "Checking DSpace version..."
3341
docker compose --env-file $ENVFILE -p $PROJECT -f docker/docker-compose.yml -f docker/cli.yml -f docker/docker-compose-rest.yml run --rm dspace-cli version
3442

3543
echo "====="

docker/docker-compose-rest.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ services:
3636
dspace__P__server__P__url: ${REST_URL:-http://127.0.0.1:8080/server}
3737
dspace__P__ui__P__url: ${UI_URL:-http://127.0.0.1:4000}
3838
# db.url: Ensure we are using the 'dspacedb' image for our database
39-
db__P__url: 'jdbc:postgresql://dspacedb:${PG_PORT}/dspace'
39+
db__P__url: 'jdbc:postgresql://pgcit17.vsb.cz:${PG_PORT}/dspace'
4040
# solr.server: Ensure we are using the 'dspacesolr' image for Solr
4141
solr__P__server: http://dspacesolr:${SOLR_PORT}/solr
4242
# proxies.trusted.ipranges: This setting is required for a REST API running in Docker to trust requests
@@ -54,8 +54,6 @@ services:
5454
assetstore__P__s3__P__pathStyleAccessEnabled: ${S3_PATH_STYLE_ACCESS:-false}
5555
assetstore__P__s3__P__endpoint: ${S3_ENDPOINT:-}
5656
image: ${DSPACE_REST_IMAGE:-dataquest/dspace:dtq-dev-7.5}
57-
depends_on:
58-
- dspacedb
5957
networks:
6058
- dspacenet
6159
ports:
@@ -103,28 +101,7 @@ services:
103101
# /dspace/bin/dspace database migrate force
104102
# /dspace/bin/start-handle-server
105103
- |
106-
while (!</dev/tcp/dspacedb/${PG_PORT}) > /dev/null 2>&1; do sleep 1; done;
107104
./custom_run.sh
108-
# DSpace database container
109-
dspacedb:
110-
restart: unless-stopped
111-
container_name: dspacedb${DSPACE_PORT}
112-
environment:
113-
TZ: ${TIMEZONE:-Europe/Bratislava}
114-
PGDATA: /pgdata
115-
POSTGRES_PASSWORD: dspace
116-
image: ${DSPACE_DB_IMAGE:-dataquest/dspace-postgres-pgcrypto:dspace-7_x}
117-
networks:
118-
dspacenet:
119-
ports:
120-
- published: ${PG_PORT}
121-
target: ${PG_PORT}
122-
host_ip: ${HOST_IP:-127.0.0.1}
123-
stdin_open: true
124-
tty: true
125-
volumes:
126-
- pgdata:/pgdata
127-
command: -p ${PG_PORT}
128105
# DSpace Solr container
129106
dspacesolr:
130107
environment:
@@ -167,7 +144,6 @@ services:
167144
volumes:
168145
# Commented out because there are a lot of files in the assetstore
169146
assetstore:
170-
pgdata:
171147
solr_data:
172148
# Special volume used to share Solr configs from 'dspace' to 'dspacesolr' container (see above)
173149
dspace_logs:

0 commit comments

Comments
 (0)