-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add reverse-proxy to manage endpoints easily (#124)
* Setup træfik (cc @jenaye) Update gitignores, add README part and .env Some fix * Fix build client * Change domain.com to smersh.lan * Update doc
- Loading branch information
Showing
21 changed files
with
13,788 additions
and
13,052 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,11 @@ | ||
API_DB_NAME=api | ||
API_DB_PASS=!ChangeMe! | ||
API_DB_USER=api-platform | ||
APP_ENV=dev | ||
CODI_DB_NAME=codimd | ||
CODI_DB_PASS=change_password | ||
CODI_DB_USER=codimd | ||
DOMAIN=smersh.lan | ||
JWT_KEY=secret-key | ||
SUBDOMAINS=(api|bitwarden|codimd) | ||
TRANSPORT=http:// |
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,4 +1,4 @@ | ||
.idea/ | ||
.env | ||
*/.env | ||
.env.local | ||
data/ |
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 |
---|---|---|
|
@@ -8,3 +8,5 @@ config/jwt/*.pem | |
/phpunit.xml | ||
.phpunit.result.cache | ||
###< phpunit/phpunit ### | ||
|
||
public/media/ |
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,2 @@ | ||
.git | ||
node_modules |
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,24 +1,48 @@ | ||
# base image | ||
FROM node:12.2.0 AS client_angular | ||
FROM node:12.16.1-alpine AS runner | ||
|
||
# install chrome for protractor tests | ||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | ||
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' | ||
RUN apt-get update && apt-get install -yq google-chrome-stable | ||
WORKDIR /usr/src/app | ||
|
||
# set working directory | ||
WORKDIR /app | ||
ARG API_BASE_URL | ||
ARG TRANSPORT | ||
ENV API_BASE_URL $API_BASE_URL | ||
ENV TRANSPORT $TRANSPORT | ||
RUN echo "Api base url: ${TRANSPORT}${API_BASE_URL}" | ||
|
||
# add `/app/node_modules/.bin` to $PATH | ||
ENV PATH /app/node_modules/.bin:$PATH | ||
COPY package.json ./ | ||
RUN npm install | ||
|
||
COPY . . | ||
|
||
RUN echo -e "\ | ||
export const environment = { \n\ | ||
production: true, \n\ | ||
API_DOMAIN: '${API_BASE_URL}', \n\ | ||
TRANSPORT: '${TRANSPORT}', \n\ | ||
API_ENDPOINT: '/api', \n\ | ||
MAPS_KEY: '', \n\ | ||
version: '1.0.0', \n\ | ||
environment: 'prod', \n\ | ||
} \n\ | ||
" > src/environments/environment.prod.ts | ||
RUN echo -e "\ | ||
export const environment = { \n\ | ||
production: true, \n\ | ||
API_DOMAIN: '${API_BASE_URL}', \n\ | ||
TRANSPORT: '${TRANSPORT}', \n\ | ||
API_ENDPOINT: '/api', \n\ | ||
MAPS_KEY: '', \n\ | ||
version: '1.0.0', \n\ | ||
environment: 'prod', \n\ | ||
} \n\ | ||
" > src/environments/environment.ts | ||
|
||
# install and cache app dependencies | ||
COPY package.json /app/package.json | ||
FROM node:12.16.1-alpine AS builder | ||
WORKDIR /usr/src/app | ||
COPY --from=runner /usr/src/app/ . | ||
RUN npm install | ||
RUN npm install -g @angular/cli@7.3.9 | ||
RUN npm run build --configuration=prod | ||
|
||
# add app | ||
COPY . /app | ||
FROM nginx:1.15.8-alpine | ||
|
||
# start app | ||
CMD ng serve --host 0.0.0.0 | ||
COPY --from=builder /usr/src/app/dist/front/ /usr/share/nginx/html | ||
COPY --from=builder /usr/src/app/docker/nginx.conf /etc/nginx/conf.d/default.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
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,8 @@ | ||
server { | ||
listen 80; | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html =404; | ||
} | ||
} |
Oops, something went wrong.