-
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
0 parents
commit f839cd4
Showing
4 changed files
with
133 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,44 @@ | ||
FROM ubuntu:trusty | ||
MAINTAINER Mark Cooper <[email protected]> | ||
|
||
ENV ARCHIVESSPACE_REPOSITORY https://github.com/archivesspace/archivesspace.git | ||
ENV ARCHIVESSPACE_DB_TYPE demo | ||
ENV ARCHIVESSPACE_DB_NAME archivesspace | ||
ENV ARCHIVESSPACE_DB_USER archivesspace | ||
ENV ARCHIVESSPACE_DB_PASS archivesspace | ||
|
||
RUN apt-get update | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \ | ||
git \ | ||
mysql-client \ | ||
openjdk-7-jre-headless \ | ||
wget \ | ||
unzip | ||
|
||
RUN wget http://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.24/mysql-connector-java-5.1.24.jar | ||
|
||
RUN mkdir -p /source | ||
RUN git clone $ARCHIVESSPACE_REPOSITORY /source/archivesspace | ||
|
||
# PROCESS BUILD | ||
WORKDIR /source/archivesspace | ||
RUN ./scripts/build_release -t | ||
RUN mv ./*.zip / | ||
RUN rm -rf /source | ||
|
||
# UNPACK BUILD | ||
WORKDIR / | ||
RUN unzip /*.zip -d / | ||
RUN rm /*.zip | ||
RUN rm -rf /archivesspace/plugins/* | ||
RUN chmod 755 /archivesspace/archivesspace.sh | ||
|
||
# FINALIZE SETUP | ||
RUN cp /mysql-connector-java-5.1.24.jar /archivesspace/lib/ | ||
ADD plugins/ /archivesspace/plugins | ||
ADD setup.sh /setup.sh | ||
RUN chmod u+x /*.sh | ||
|
||
EXPOSE 8080 8081 8089 8090 | ||
|
||
CMD ["/setup.sh"] |
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,72 @@ | ||
Docker ArchivesSpace builds | ||
--------------------------- | ||
|
||
**Automated builds** | ||
|
||
- docker hub integration (build on push) | ||
- also trigger from _archivesspace_/archivesspace to build on hub | ||
- webhook from hub to deploy via docker on server (captain webhook) | ||
|
||
**Manual builds** | ||
|
||
Clone this repository, `cd` to it and: | ||
|
||
``` | ||
docker build --no-cache --rm=true -t archivesspace/build:latest . | ||
``` | ||
|
||
**Running** | ||
|
||
Use `archivesspace/build:latest` in place of `markcooper/archivesspace-build` for local builds. | ||
|
||
``` | ||
# background mode | ||
docker run --name build -d \ | ||
-p 8080:8080 \ | ||
-p 8081:8081 \ | ||
-p 8089:8089 \ | ||
-p 8090:8090 \ | ||
markcooper/archivesspace-build | ||
# foreground mode | ||
docker run --name build -i -t \ | ||
-p 8080:8080 \ | ||
-p 8081:8081 \ | ||
-p 8089:8089 \ | ||
-p 8090:8090 \ | ||
markcooper/archivesspace-build | ||
# foreground mode and access container | ||
docker run --name build -i -t \ | ||
-p 8080:8080 \ | ||
-p 8081:8081 \ | ||
-p 8089:8089 \ | ||
-p 8090:8090 \ | ||
markcooper/archivesspace-build /bin/bash | ||
``` | ||
|
||
**With MySQL** | ||
|
||
``` | ||
# pull and run the official mysql docker image | ||
docker run -d \ | ||
-p 3306:3306 \ | ||
--name mysql \ | ||
-e MYSQL_ROOT_PASSWORD=123456 \ | ||
-e MYSQL_DATABASE=archivesspace \ | ||
-e MYSQL_USER=archivesspace \ | ||
-e MYSQL_PASSWORD=archivesspace \ | ||
mysql | ||
# foreground mode | ||
docker run --name build -i -t \ | ||
-p 8080:8080 \ | ||
-p 8081:8081 \ | ||
-p 8089:8089 \ | ||
-p 8090:8090 \ | ||
-e ARCHIVESSPACE_DB_TYPE=mysql \ | ||
--link mysql:db \ | ||
markcooper/archivesspace-build | ||
``` | ||
|
||
--- |
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,2 @@ | ||
* | ||
!.gitignore |
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,15 @@ | ||
#!/bin/bash | ||
|
||
cat /dev/null > /archivesspace/config/config.rb | ||
|
||
if [[ "$ARCHIVESSPACE_DB_TYPE" == "mysql" ]]; then | ||
echo "AppConfig[:db_url] = 'jdbc:mysql://$DB_PORT_3306_TCP_ADDR:3306/$ARCHIVESSPACE_DB_NAME?user=$ARCHIVESSPACE_DB_USER&password=$ARCHIVESSPACE_DB_PASS&useUnicode=true&characterEncoding=UTF-8'" \ | ||
>> /archivesspace/config/config.rb | ||
/archivesspace/scripts/setup-database.sh | ||
fi | ||
|
||
for PLUGIN in /archivesspace/plugins/*; do | ||
[[ -d $PLUGIN ]] && echo "AppConfig[:plugins] << '${PLUGIN##*/}'" >> /archivesspace/config/config.rb | ||
done | ||
|
||
exec /archivesspace/archivesspace.sh |