You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Prepare the host and reverse proxy configuration for Letsencrypt SSL certificate
39
+
To use it you have to either generate a self-signed certificate, or provide a real certificate.
22
40
23
-
Install certbot on the host according to the instructions found here: https://certbot.eff.org/lets-encrypt/ubuntubionic-other
24
-
Replace `**domain_name**` with your correct domain name in docker-nginx/nginx.conf
25
-
26
-
The complete code is available in the `using_letsecrypt_ssl` branch - see https://github.com/empear-analytics/docker-codescene-nginx-self-signed-ssl/commit/1db5245b40b10ee954e3b23261f40b6e29a4b665.
27
-
28
-
## Build
29
-
30
-
The reverse proxy using Nginx is built like this:
31
-
32
-
docker build -t reverseproxy docker-nginx/
33
-
34
-
The CodeScene image is available from [Docker Hub](https://hub.docker.com/r/empear/ubuntu-onprem/).
35
-
36
-
If you want to use a specific version of CodeScene, you can add a tag in the `docker-compose.yml`:
41
+
## Generate a self-signed certificate
37
42
43
+
Generate a self-signed certificate in the `nginx/conf.d` folder with a command like
In both the reverse proxy setup and the standalone version, the
66
-
`/codescene` directory in the container is bound to the local
67
-
`codescene` subdirectory. It will contain two directories, `repos` and
68
-
`analyses` that are used to store Git repositories and the analysis
69
-
result files that CodeScene produces. CodeScene's internal database is
70
-
also stored in `/codescene`, as well as a logfile. By using these directories, your data
71
-
will be persisted beyond the life of the Docker container.
72
-
73
-
Both the standalone command presented above and the `docker-compose` configuration use the `bind` mount type, for
74
-
ease of demonstration and debugging. In a production setting, [Docker
75
-
volumes](https://docs.docker.com/storage/volumes) would be a better
76
-
solution.
77
50
78
-
The configuration presented here uses CodeScene's optional environment
79
-
variables `CODESCENE_ANALYSIS_RESULTS_ROOT` and
80
-
`CODESCENE_CLONED_REPOSITORIES_ROOT`. Their purpose is to ensure that users cannot create
81
-
repositories or store analysis results outside of the `/codescene`
82
-
directory. In conjunction with the `CODESCENE_DB_PATH`, we can be sure
83
-
that all the necessary data for persisting CodeScene is in a single,
84
-
easy-to-manage location. You can of course adjust these variables to
85
-
fit your specific needs.
51
+
## Provide a custom SSL certificate
52
+
Place the ssl certificate and private key files in the *nginx/conf.d* folder to make them accessible in the nginx container.
53
+
Update the *nginx/conf.d/reverseproxy.conf* file with `ssl_certificate` and `ssl_certificate_key` set to your certificate and key file names, and with `server_name` set to match your certificate.
86
54
87
-
Whether you use volumes or bind mounts, they must be passed to the
88
-
Docker container at run time.
89
-
90
-
In the full reverse proxy setup using `docker-compose`, this is done
91
-
in the `volumes` stanza of the configuration. The
92
-
[`docker-compose.yml`](docker-compose.yml) file in this repository
93
-
uses a Docker volume. To use a bind mount with `docker-compose`, or
94
-
for more detailed instructions, please refer to the documentation
[support for `-XX:+UseCGroupMemoryLimitForHeap` has been deprecated in JDK 10](https://bugs.openjdk.java.net/browse/JDK-8194086)
234
-
and is no longer needed.
81
+
Use `docker-compose` to start both instances:
235
82
236
-
For more details, see
237
-
[Java inside docker: What you must know to not FAIL](https://developers.redhat.com/blog/2017/03/14/java-inside-docker/).
83
+
docker-compose up -d
238
84
239
-
Ppre
240
-
### Timezones
241
85
242
-
CodeScene, in general, uses default system's timezone.
243
-
In our docker image we set the default timezone explicitly to UTC via the `CODESCENE_TIMEZONE` env var.
244
-
This can be overriden when the docker image is run:
245
-
```
246
-
docker run -p3003 -e CODESCENE_TIMEZONE='Europe/Stockholm' empear/ubuntu-onprem
247
-
```
248
-
Note that if you use docker-compose you need to leave out quotes:
249
-
```
250
-
environment:
251
-
- CODESCENE_TIMEZONE=Europe/Stockholm
252
-
```
253
86
254
-
###Use
87
+
## Use
255
88
256
89
Browse to https://localhost. In order to use CodeScene, you will need a
257
90
license. You can get a license on the [Empear Customer Portal](https://portal.empear.com/).
258
91
For more information about CodeScene, see the [CodeScene Documentation](https://docs.enterprise.codescene.io/).
259
92
260
-
###Stop
93
+
## Stop
261
94
262
95
To stop the reverse proxy:
263
96
264
97
docker-compose down
265
98
266
99
267
-
###License, Liability & Support
100
+
# License, Liability & Support
268
101
269
102
* The contents of this repository are provided under the [MIT License](https://github.com/empear-analytics/docker-codescene-nginx-self-signed-ssl/blob/master/LICENSE.md). Other licences may apply to the software contained in the Docker images referenced here.
270
103
271
104
272
-
###Analyze this this project on CodeScene
105
+
# Analyze this this project on CodeScene
273
106
274
107
[ Get more details at **codescene.io**.](https://codescene.io/projects/2554/jobs/latest-successful/results)
0 commit comments