-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release/23.04
- Loading branch information
Showing
14 changed files
with
217 additions
and
70 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,2 @@ | ||
# The root of backend api. Have to match the SITE_ROOT value on openIMIS backend | ||
REACT_APP_API_URL=api |
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,22 @@ | ||
name: create manual docker image | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
required: true | ||
|
||
jobs: | ||
publish-manual-docker-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build the openimis backend Docker image | ||
run: | | ||
docker build . --tag ghcr.io/openimis/openimis-fe:${{ github.event.inputs.tag }} | ||
docker push ghcr.io/openimis/openimis-fe:${{ github.event.inputs.tag }} |
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,22 @@ | ||
name: create daily docker image on develop | ||
on: | ||
schedule: | ||
- cron: "0 2 * * *" | ||
jobs: | ||
publish-docker-develop-image: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: develop | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build the openimis backend Docker image | ||
run: | | ||
LABEL=develop | ||
docker build . --tag ghcr.io/openimis/openimis-fe:${LABEL} | ||
docker push ghcr.io/openimis/openimis-fe:${LABEL} |
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 |
---|---|---|
|
@@ -8,4 +8,5 @@ modules-unlinks.txt | |
src/modules.js | ||
src/locales.js | ||
.idea | ||
yarn.lock | ||
yarn.lock | ||
.env |
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,11 +1,39 @@ | ||
FROM node:16 AS react-build | ||
RUN mkdir app | ||
FROM node:16 AS build-stage | ||
RUN mkdir /app | ||
COPY ./ /app | ||
WORKDIR /app | ||
RUN chown node /app -R | ||
RUN npm install --global serve | ||
RUN apt-get update && apt-get install -y nano openssl software-properties-common | ||
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/privkey.pem -out /etc/ssl/private/fullchain.pem -subj "/C=DE/ST=_/L=_/O=_/OU=_/CN=localhost" | ||
USER node | ||
ARG OPENIMIS_CONF_JSON | ||
ENV OPENIMIS_CONF_JSON=${OPENIMIS_CONF_JSON} | ||
RUN yarn load-config | ||
RUN yarn install | ||
RUN yarn build | ||
RUN yarn global add serve | ||
CMD ["yarn","start"] | ||
ENV NODE_ENV=production | ||
RUN npm run load-config | ||
RUN npm install | ||
RUN npm run build | ||
|
||
|
||
### NGINX | ||
|
||
|
||
FROM nginx:latest | ||
#COPY APP | ||
COPY --from=build-stage /app/build/ /usr/share/nginx/html | ||
#COPY DEFAULT CERTS | ||
COPY --from=build-stage /etc/ssl/private/ /etc/nginx/ssl/live/host | ||
|
||
COPY conf/openimis.conf /conf/openimis.conf | ||
COPY script/entrypoint.sh /script/entrypoint.sh | ||
RUN chmod a+x /script/entrypoint.sh | ||
WORKDIR /script | ||
ENV DATA_UPLOAD_MAX_MEMORY_SIZE=12582912 | ||
ENV NEW_OPENIMIS_HOST="localhost" | ||
ENV PUBLIC_URL="front" | ||
ENV REACT_APP_API_URL="api" | ||
ENV ROOT_MOBILEAPI="rest" | ||
ENV FORCE_RELOAD="" | ||
|
||
ENTRYPOINT ["/bin/bash","/script/entrypoint.sh"] | ||
CMD ["nginx", "-g", "daemon off;"] |
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,14 @@ | ||
events { | ||
worker_connections 4096; ## Default: 1024 | ||
} | ||
|
||
http { | ||
include mime.types; | ||
default_type application/octet-stream; | ||
access_log ./logs/access.log; | ||
error_log ./logs/error.log debug; | ||
sendfile on; | ||
keepalive_timeout 65; | ||
gzip on; | ||
include ./conf/openIMIS.conf; | ||
} |
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,50 @@ | ||
|
||
server { | ||
resolver 127.0.0.11 valid=30s; | ||
set $dockerbackend "backend:8000"; | ||
set $dockerrestapi "restapi:80"; | ||
|
||
client_max_body_size ${DATA_UPLOAD_MAX_MEMORY_SIZE}; | ||
listen 443 ssl; | ||
listen 80; | ||
server_name ${NEW_OPENIMIS_HOST}; | ||
|
||
ssl_certificate /etc/letsencrypt/live/${NEW_OPENIMIS_HOST}/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/${NEW_OPENIMIS_HOST}/privkey.pem; | ||
root /usr/share/nginx/html; | ||
location /.well-known/acme-challenge/ { | ||
root /var/www/certbot; | ||
} | ||
location /.well-known { | ||
root /var/www/html; | ||
} | ||
|
||
location / { | ||
return 302 https://$host/${PUBLIC_URL}/${REDIRECT_TAIL}; | ||
} | ||
|
||
location /${PUBLIC_URL} { | ||
try_files $uri $uri/ /${PUBLIC_URL}/index.html; | ||
#error_page 404 $scheme://$host/front/; | ||
} | ||
|
||
location /${REACT_APP_API_URL}/ { | ||
proxy_pass http://${dockerbackend}; | ||
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 $server_name; | ||
proxy_set_header X-Forwarded-Proto https; | ||
} | ||
|
||
location /${ROOT_MOBILEAPI}/ { | ||
#this rewrite rule is required to remove "ROOT_MOBILEAPI" because implicite rule (/ at the end of the url) donc work with variable | ||
rewrite /${ROOT_MOBILEAPI}/(.*) /$1 break; | ||
proxy_pass http://${dockerrestapi}; | ||
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 https; | ||
proxy_set_header X-Forwarded-Host $server_name; | ||
} | ||
} |
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
Oops, something went wrong.