- Runs on a production ready OpenJDK 8 - Zulu by Azul Systems.
- Ready to be configured with Nginx as a reverse proxy (https available).
- Built on top of Debian for a minimal image size.
docker run -d -p 7990:7990 -p 7999:7999 ahaasler/stash
You can use this parameters to configure your stash instance:
- -s: Enables the connector security and sets
https
as connector scheme. - -n <proxyName>: Sets the connector proxy name.
- -p <proxyPort>: Sets the connector proxy port.
- -c <contextPath>: Sets the context path (do not write the initial /).
This parameters should be given to the entrypoint (passing them after the image):
docker run -d -p 7990:7990 -p 7999:7999 ahaasler/stash <parameters>
If you want to execute another command instead of launching stash you should overwrite the entrypoint with
--entrypoint <command>
(docker run parameter).
Lets say you have the following nginx configuration for stash:
server {
listen 80;
server_name example.com;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name example.com;
ssl on;
ssl_certificate /path/to/certificate.crt;
ssl_certificate_key /path/to/key.key;
location /stash {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:7990;
proxy_redirect off;
}
}
This is only an example, please secure you nginx better.
For that configuration you should run your stash container with:
docker run -d -p 7990:7990 -p 7999:7999 ahaasler/stash -s -n example.com -p 443 -c stash
The stash home is set to /data/stash
. If you want to persist your data you should use a data volume for /data/stash
.
docker run -d -p 7990:7990 -p 7999:7999 -v /home/user/stash-data:/data/stash ahaasler/stash
Make sure that the stash user (with id 782) has read/write/execute permissions.
If security is important follow the Atlassian recommendation:
Ensure that only the user running Stash can access the Stash home directory, and that this user has read, write and execute permissions, by setting file system permissions appropriately for your operating system.
-
Create the data-only container and set proper permissions:
-
Lazy way (preferred) - Using docker-stash-data:
-
docker run --name stash-data ahaasler/stash-data ```
* *I-wan't-to-know-what-I'm-doing* way:
```bash
docker run --name stash-data -v /data/stash busybox true docker run --rm -it --volumes-from stash-data debian bash ```
The last command will open a *debian* container. Execute this inside that container:
```bash
chown 782:root /data/stash; chmod 770 /data/stash; exit; ```
-
Use it in the stash container:
docker run --name stash --volumes-from stash-data -d -p 7990:7990 -p 7999:7999 ahaasler/stash ```
A great way to connect your Stash instance with a PostgreSQL database is using the docker-stash-postgres image.
-
Create and name the database container:
docker run --name stash-postgres -d ahaasler/stash-postgres ```
-
Use it in the Stash container:
docker run --name stash --link stash-postgres:stash-postgres -d -p 7990:7990 -p 7999:7999 ahaasler/stash ```
- Connect your Stash instance following the Atlassian documentation: Connecting Stash to PostgreSQL.
See docker-stash-postgres for more information an configuration options.
- Docker for this amazing container engine.
- PostgreSQL for this advanced database.
- Atlassian for making great products. Also for their work on atlassian-docker which inspired this.
- Azul Systems for their OpenJDK docker base image.
- And specially to you and the entire community.
This image is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.