-
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
1 parent
4b0ac59
commit a87300e
Showing
14 changed files
with
189 additions
and
28 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
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,37 @@ | ||
FROM node:latest | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y git \ | ||
openssh-server | ||
|
||
RUN mkdir /var/run/sshd | ||
EXPOSE 22 | ||
|
||
ARG SSH_KEY | ||
ARG SSH_KEY_PASSPHRASE | ||
RUN chmod go-w /root | ||
|
||
RUN mkdir -p /root/.ssh && \ | ||
chmod 600 /root/.ssh | ||
|
||
RUN echo "$SSH_KEY" >> /root/.ssh/id_rsa && \ | ||
echo "$SSH_KEY_PASSPHRASE" >> /root/.ssh/id_rsa.pub | ||
|
||
RUN chmod -R 600 /root/.ssh/id_rsa && \ | ||
chmod -R 600 /root/.ssh/id_rsa.pub | ||
|
||
RUN ssh-keyscan -Ht rsa forgemia.inra.fr,147.100.164.13 >> ~/.ssh/known_hosts | ||
|
||
RUN mkdir /app/ | ||
|
||
WORKDIR /app/ | ||
|
||
RUN git clone [email protected]:magnus.anatolius/in-sylva.doc.git | ||
|
||
RUN cd ./in-sylva.doc/website && yarn | ||
|
||
EXPOSE 3000 35729 | ||
|
||
WORKDIR /app/in-sylva.doc/website/ | ||
|
||
CMD ["yarn", "start"] |
Empty file.
Empty file.
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
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 |
---|---|---|
@@ -1,10 +1,5 @@ | ||
REACT_APP_IN_SYLVA_GATEKEEPER_HOST=/gatekeeper | ||
REACT_APP_IN_SYLVA_GATEKEEPER_PORT=4000 | ||
|
||
REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST=/source-manager | ||
REACT_APP_IN_SYLVA_SOURCE_MANAGER_PORT=5000 | ||
|
||
REACT_APP_IN_SYLVA_KEYCLOAK_HOST=/keycloak | ||
REACT_APP_IN_SYLVA_KEYCLOAK_PORT=7000 | ||
|
||
REACT_APP_PORT=3000 |
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
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,7 @@ | ||
window._env_ = { | ||
REACT_APP_IN_SYLVA_GATEKEEPER_HOST: "/gatekeeper", | ||
REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST: "/source-manager", | ||
REACT_APP_IN_SYLVA_KEYCLOAK_HOST: "/keycloak", | ||
REACT_APP_IN_SYLVA_KEYCLOAK_PORT: "7000", | ||
REACT_APP_PORT: "3000", | ||
} |
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
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,10 @@ | ||
REACT_APP_IN_SYLVA_GATEKEEPER_HOST=/gatekeeper | ||
REACT_APP_IN_SYLVA_GATEKEEPER_PORT=4000 | ||
|
||
REACT_APP_IN_SYLVA_SOURCE_MANAGER_HOST=/source-manager | ||
REACT_APP_IN_SYLVA_SOURCE_MANAGER_PORT=5000 | ||
|
||
REACT_APP_IN_SYLVA_KEYCLOAK_HOST=/keycloak | ||
REACT_APP_IN_SYLVA_KEYCLOAK_PORT=7000 | ||
|
||
REACT_APP_PORT=3000 |
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
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
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,29 @@ | ||
#!/bin/bash | ||
|
||
# Recreate config file | ||
rm -rf ./env-config.js | ||
touch ./env-config.js | ||
|
||
# Add assignment | ||
echo "window._env_ = {" >> ./env-config.js | ||
|
||
# Read each line in .env file | ||
# Each line represents key=value pairs | ||
while read -r line || [[ -n "$line" ]]; | ||
do | ||
# Split env variables by character `=` | ||
if printf '%s\n' "$line" | grep -q -e '='; then | ||
varname=$(printf '%s\n' "$line" | sed -e 's/=.*//') | ||
varvalue=$(printf '%s\n' "$line" | sed -e 's/^[^=]*=//') | ||
fi | ||
|
||
# Read value of current variable if exists as Environment variable | ||
value=$(printf '%s\n' "${!varname}") | ||
# Otherwise use value from .env file | ||
[[ -z $value ]] && value=${varvalue} | ||
|
||
# Append configuration property to JS file | ||
echo " $varname: \"$value\"," >> ./env-config.js | ||
done < .env | ||
|
||
echo "}" >> ./env-config.js |
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 |
---|---|---|
@@ -1,27 +1,102 @@ | ||
server { | ||
|
||
resolver 127.0.0.1 [::]; | ||
|
||
upstream backend_gatekeeper { | ||
server gatekeeper:4000; | ||
} | ||
|
||
upstream backend_keycloak { | ||
server keycloak:7000; | ||
} | ||
|
||
upstream backend_source_manager { | ||
server source-manager:5000; | ||
} | ||
|
||
server { | ||
include /etc/nginx/mime.types; | ||
listen 3000; | ||
listen 4000; | ||
listen 5000; | ||
listen 7000; | ||
listen [::]:3000; | ||
server_name _; | ||
|
||
access_log /var/log/nginx/host.access.log; | ||
error_log /var/log/nginx/host.error.log; | ||
|
||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
|
||
location /gatekeeper/ { | ||
proxy_pass http://backend_gatekeeper/; | ||
|
||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /keycloak/ { | ||
proxy_pass http://backend_keycloak/; | ||
|
||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $host; | ||
proxy_set_header X-Forwarded-Server $host; | ||
proxy_set_header X-Forwarded-Port $server_port; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /keycloak/auth/ { | ||
proxy_pass http://backend_keycloak/keycloak/auth/; | ||
|
||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Host $host; | ||
proxy_set_header X-Forwarded-Server $host; | ||
proxy_set_header X-Forwarded-Port $server_port; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location /source-manager/ { | ||
proxy_pass http://backend_source_manager/; | ||
|
||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
proxy_http_version 1.1; | ||
proxy_set_header upgrade $http_upgrade; | ||
proxy_set_header connection keep-alive; | ||
proxy_set_header host $host; | ||
proxy_cache_bypass $http_upgrade; | ||
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; | ||
proxy_set_header x-forwarded-proto $scheme; | ||
root /usr/share/nginx/html; | ||
index index.html; | ||
autoindex on; | ||
set $fallback_file /index.html; | ||
if ($http_accept !~ text/html) { | ||
set $fallback_file /null; | ||
} | ||
if ($uri ~ /$) { | ||
set $fallback_file /null; | ||
} | ||
try_files $uri $fallback_file; | ||
|
||
if ($request_method = 'OPTIONS') { | ||
add_header 'Access-Control-Allow-Origin: $http_origin'); | ||
add_header 'Access-Control-Allow-Origin: GET, POST, DELETE, PUT, PATCH, OPTIONS'); | ||
add_header 'Access-Control-Allow-Credentials: true'); | ||
add_header 'Vary: Origin'); | ||
|
||
} | ||
|
||
add_header 'Access-Control-Allow-Origin' "$http_origin" always; | ||
add_header 'Access-Control-Allow-Credentials' 'true' always; | ||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, PATCH, DELETE, OPTIONS' always; | ||
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With' always; | ||
} | ||
|
||
error_page 500 502 503 504 /50x.html; | ||
|
||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
} |