Skip to content

Commit

Permalink
feat: #3328 add nginx in docker (#3329)
Browse files Browse the repository at this point in the history
* feat: #3328 add nginx in docker

* feat: #3328 fix file names and update readme

* feat: #3328 fix file names
  • Loading branch information
celinepelletier authored Jan 12, 2022
1 parent 991e84f commit 51fa29f
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 0 deletions.
51 changes: 51 additions & 0 deletions docker/nginx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Run NGINX in Docker

## Requirements

- Docker (18.03+ for Mac/Windows, 20.04+ for Linux)
- KF-portal-UI is running locally on port 3000
- `portal-qa.kidsfirstdrc.org` and/or `portal.kidsfirstdrc.org` added to hosts file

## QA

### Build image:

```
docker build -f qa.Dockerfile -t kf-nginx-qa .
```

### Run image:

For Mac/Windows:

```
docker run -p 443:443 -p 80:80 -d kf-nginx-qa
```

For Linux:

```
docker run -p 443:443 -p 80:80 --add-host=host.docker.internal:host-gateway -d kf-nginx-qa
```

## PRD

### Build image:

```
docker build -f prd.Dockerfile -t kf-nginx-prd .
```

### Run image:

For Mac/Windows:

```
docker run -p 443:443 -p 80:80 -d kf-nginx-prd
```

For Linux:

```
docker run -p 443:443 -p 80:80 --add-host=host.docker.internal:host-gateway -d kf-nginx-prd
```
13 changes: 13 additions & 0 deletions docker/nginx/nginx-prd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# PRD
server {
listen 443 ssl;
ssl_certificate /etc/nginx/prd.crt;
ssl_certificate_key /etc/nginx/prd.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
server_name portal.kidsfirstdrc.org;
location / {
proxy_pass https://host.docker.internal:3000;
}
}
13 changes: 13 additions & 0 deletions docker/nginx/nginx-qa.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# PRD
server {
listen 443 ssl;
ssl_certificate /etc/nginx/qa.crt;
ssl_certificate_key /etc/nginx/qa.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
server_name portal-qa.kidsfirstdrc.org;
location / {
proxy_pass https://host.docker.internal:3000;
}
}
5 changes: 5 additions & 0 deletions docker/nginx/prd.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY prd.crt /etc/nginx/prd.crt
COPY prd.key /etc/nginx/prd.key
COPY nginx-prd.conf /etc/nginx/conf.d/default.conf
22 changes: 22 additions & 0 deletions docker/nginx/prd.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDtjCCAp4CCQD6Jui1KJKmTjANBgkqhkiG9w0BAQsFADCBnDELMAkGA1UEBhMC
Q0ExDzANBgNVBAgMBlF1ZWJlYzETMBEGA1UEBwwKVGVycmVib25uZTEOMAwGA1UE
CgwFQ0hVU0oxDzANBgNVBAsMBkZlcmxhYjEgMB4GA1UEAwwXcG9ydGFsLmtpZHNm
aXJzdGRyYy5vcmcxJDAiBgkqhkiG9w0BCQEWFWNwZWxsZXRpZXJAZmVybGFiLmJp
bzAeFw0yMTA0MjcxODQ2MTVaFw0yMjA0MjcxODQ2MTVaMIGcMQswCQYDVQQGEwJD
QTEPMA0GA1UECAwGUXVlYmVjMRMwEQYDVQQHDApUZXJyZWJvbm5lMQ4wDAYDVQQK
DAVDSFVTSjEPMA0GA1UECwwGRmVybGFiMSAwHgYDVQQDDBdwb3J0YWwua2lkc2Zp
cnN0ZHJjLm9yZzEkMCIGCSqGSIb3DQEJARYVY3BlbGxldGllckBmZXJsYWIuYmlv
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs6SLVx10ZZ02EjPvc4qz
2PtKzlb4/Yjg/jvDL1WGZXikUpU/uFxLZ4SwyZwLWBVUhNXyr6SloP+Dy1Ka0Vgh
HDEiE8DZIjTeYUVakXRxfDiBHxFYvOU5PVv9dKiI17xLQxvPye9VRRB4FcoW/3Jm
7A2GTxmIRExElcrmk4zmqpxRWVrk20tRNgwzOJJUnAGhjDGUbS3v79Wqyl1QwT12
ap+0n5kpXn1DI5h0MbnueBrCY/e36ks5hd7+w5kGgVcU0Yq7bEzrzLkL182uzrFI
6tcUMA/enOE03SMJwi3qRQX0VKtn4KA3TRa86B1WjIMWM0Wk0UoT/PzBBwinjqZ4
6QIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQChed0QiRPq/w9zjLVprDKTlScp+FpK
RWLAtMZFLNoow4+VVIZH4ylAxgAPblomX3/wHLCbYZ+DFu2AULMKfgaqwEa/bMdg
vVrBBItbW30qdHmCW8md9o1O6zhRmX4KQHH6T7Jnul9f1+XYnp2/p4XnJML0/Oef
D0JFZa6/ec+VTatSmbpOttzZO47Xfp0BEfEn5CaRo1dnfeUfnB1yE60aVyo6ebLb
PWlKyaWH3CXxHkywJOo3TedwME7vkM6sw/lGoCuhC40lBBIEu+s1KA21336ATrz9
MnCIZF/tBtsWQKyeaOV/acpY5ZXUrkrrhSgY+RNugCs0HJg9pKoxiMPl
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions docker/nginx/prd.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzpItXHXRlnTYS
M+9zirPY+0rOVvj9iOD+O8MvVYZleKRSlT+4XEtnhLDJnAtYFVSE1fKvpKWg/4PL
UprRWCEcMSITwNkiNN5hRVqRdHF8OIEfEVi85Tk9W/10qIjXvEtDG8/J71VFEHgV
yhb/cmbsDYZPGYhETESVyuaTjOaqnFFZWuTbS1E2DDM4klScAaGMMZRtLe/v1arK
XVDBPXZqn7SfmSlefUMj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
Jc1EZ04ZW1c6j1ShTyGxP47zZdSUDHeZt9gBHI2ccfdB56FR9x1eO0Z1d1vb3/JR
WnvyMHk9ZWLSMKa4uAqgO2J3/Ao0aBsjwK1XRV0pAoGAOYsEaVt0xHA4Tz1/0Iq3
t0A/NApilI4m8+MtWf32gTLUtkKElxDkL/nCK148iFzNlikX6sZP0gHQ33YsQMaH
vHsHC6rEW9OSPpkavgVbRnzVJtZliTc9qN2NrHwwqe+JgqOn/NN9PyJcoO5XLChc
uqWbHDX8Q2jCXIt8aEoV8XY=
-----END PRIVATE KEY-----
5 changes: 5 additions & 0 deletions docker/nginx/qa.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY qa.crt /etc/nginx/qa.crt
COPY qa.key /etc/nginx/qa.key
COPY nginx-qa.conf /etc/nginx/conf.d/default.conf
22 changes: 22 additions & 0 deletions docker/nginx/qa.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
-----BEGIN CERTIFICATE-----
MIIDvDCCAqQCCQDLxgt4T1m5cTANBgkqhkiG9w0BAQsFADCBnzELMAkGA1UEBhMC
Q0ExDzANBgNVBAgMBlF1ZWJlYzETMBEGA1UEBwwKVGVycmVib25uZTEOMAwGA1UE
CgwFQ0hVU0oxDzANBgNVBAsMBkZlcmxhYjEjMCEGA1UEAwwacG9ydGFsLXFhLmtp
ZHNmaXJzdGRyYy5vcmcxJDAiBgkqhkiG9w0BCQEWFWNwZWxsZXRpZXJAZmVybGFi
LmJpbzAeFw0yMTA0MjcxNzAxMDFaFw0yMjA0MjcxNzAxMDFaMIGfMQswCQYDVQQG
EwJDQTEPMA0GA1UECAwGUXVlYmVjMRMwEQYDVQQHDApUZXJyZWJvbm5lMQ4wDAYD
VQQKDAVDSFVTSjEPMA0GA1UECwwGRmVybGFiMSMwIQYDVQQDDBpwb3J0YWwtcWEu
a2lkc2ZpcnN0ZHJjLm9yZzEkMCIGCSqGSIb3DQEJARYVY3BlbGxldGllckBmZXJs
YWIuYmlvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA61mzYbc3cjqG
AjOHFukT0swhblaWPG4pv+mnffiTgXRB8gmS8hUD1fbJw3DonpKxbvjp6i6V3vYG
3qimec4bi9/Wa4e2TCaTr+l4CO0dZzkIZMPGCySDDfy+mRj03AzcsJodrOdwqoog
FiRXWqke2vhwh9hmFNmWbBxaBP0mNav44xKZQDbz/5WO01+W3da5G5CvmfFgwb7h
b/17PBOvrCW3YICV0dYoADDNlukc4Yk6GS+3wUjK5JVBoDWjGO3hTUE3KitcZddu
oXgp6Q3J/efz9yzyglewUGyKksFAGTifuLZme73gG2u+1CXp9URpS300u42oZ2zM
TbjySGkgFwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQAuS6ty/qvqVfO7E+2A8Cfg
jGKLIeVB++OD+Fcl4BQYSUnkORf85cWjdPjgLuHc2EgBsgKY9dtD1lKUCYEfpNzJ
DN0UpmjJoM+ujY+zmCfInp2XIyRM5HnU25tu9k5fzFXRbBUGh7+NxBXhavJ0aOQh
g6WN1Ao0ln6Ulj54MNcJkzHBxKm9giwVlKhGIw0eqCnyRrHJnpmSDccsVnNY96Vi
cbTGeF9Bkg5wLnCHg5fvNdlifx953Wfkrp2RuHxB98Pve1WuXRuk8A7MJEiGqtGP
i1hEtK7mUDLFrb2kbZ63+7g6WEQsoDzN8g2fa4FVgf1K7RKOaKsTegtUqBun1+bP
-----END CERTIFICATE-----
28 changes: 28 additions & 0 deletions docker/nginx/qa.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDrWbNhtzdyOoYC
M4cW6RPSzCFuVpY8bim/6ad9+JOBdEHyCZLyFQPV9snDcOiekrFu+OnqLpXe9gbe
qKZ5zhuL39Zrh7ZMJpOv6XgI7R1nOQhkw8YL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