diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 31e1c2cd3..f0649130d 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -4,13 +4,21 @@ version: "3.8" services: reverse_proxy: - image: nginx:alpine ports: - "80:80" volumes: - ./reverse-proxy/conf.d.dev:/etc/nginx/conf.d:ro command: ["nginx-debug", "-g", "daemon off;"] + web: + build: + dockerfile: debug.Dockerfile + volumes: + - .:/app + - /app/node_modules + environment: + - CHOKIDAR_USEPOLLING=true + directory.api: build: dockerfile: directory/src/FilterLists.Directory.Api/debug.Dockerfile @@ -19,4 +27,4 @@ services: - ASPNETCORE_URLS=http://+:80 directory.db: - command: ["postgres", "-c", "log_statement=all"] \ No newline at end of file + command: ["postgres", "-c", "log_statement=all"] diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 1e79040df..7944c5cf1 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -4,9 +4,8 @@ version: "3.8" services: reverse_proxy: - image: nginx:alpine ports: - "443:443" volumes: - ./reverse-proxy/conf.d:/etc/nginx/conf.d:ro - - ~/cert:/etc/nginx/cert:ro \ No newline at end of file + - ~/cert:/etc/nginx/cert:ro diff --git a/docker-compose.yml b/docker-compose.yml index 2a5a11c47..610716038 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,4 +49,4 @@ networks: directory: volumes: - directory.db: \ No newline at end of file + directory.db: diff --git a/reverse-proxy/conf.d.dev/filterlists.conf b/reverse-proxy/conf.d.dev/filterlists.conf index 51a01496b..8e8910fe6 100644 --- a/reverse-proxy/conf.d.dev/filterlists.conf +++ b/reverse-proxy/conf.d.dev/filterlists.conf @@ -14,7 +14,7 @@ server { } location / { - proxy_pass http://web:80; + proxy_pass http://web:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; diff --git a/services/FilterLists.sln.DotSettings b/services/FilterLists.sln.DotSettings index a48e85f7f..076a77a76 100644 --- a/services/FilterLists.sln.DotSettings +++ b/services/FilterLists.sln.DotSettings @@ -1,7 +1,4 @@ - + <?xml version="1.0" encoding="utf-16"?><Profile name="FilterLists Cleanup"><CSReorderTypeMembers>True</CSReorderTypeMembers><XMLReformatCode>True</XMLReformatCode><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeArgumentsStyle="True" ArrangeCodeBodyStyle="True" ArrangeVarStyle="True" ArrangeTrailingCommas="True" /><RemoveCodeRedundanciesVB>True</RemoveCodeRedundanciesVB><Xaml.RedundantFreezeAttribute>True</Xaml.RedundantFreezeAttribute><Xaml.RemoveRedundantModifiersAttribute>True</Xaml.RemoveRedundantModifiersAttribute><Xaml.RemoveRedundantNameAttribute>True</Xaml.RemoveRedundantNameAttribute><Xaml.RemoveRedundantResource>True</Xaml.RemoveRedundantResource><Xaml.RemoveRedundantCollectionProperty>True</Xaml.RemoveRedundantCollectionProperty><Xaml.RemoveRedundantAttachedPropertySetter>True</Xaml.RemoveRedundantAttachedPropertySetter><Xaml.RemoveRedundantStyledValue>True</Xaml.RemoveRedundantStyledValue><Xaml.RemoveRedundantNamespaceAlias>True</Xaml.RemoveRedundantNamespaceAlias><Xaml.RemoveForbiddenResourceName>True</Xaml.RemoveForbiddenResourceName><Xaml.RemoveRedundantGridDefinitionsAttribute>True</Xaml.RemoveRedundantGridDefinitionsAttribute><Xaml.RemoveRedundantGridSpanAttribut>True</Xaml.RemoveRedundantGridSpanAttribut><Xaml.RemoveRedundantUpdateSourceTriggerAttribute>True</Xaml.RemoveRedundantUpdateSourceTriggerAttribute><Xaml.RemoveRedundantBindingModeAttribute>True</Xaml.RemoveRedundantBindingModeAttribute><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CorrectVariableKindsDescriptor>True</CorrectVariableKindsDescriptor><VariablesToInnerScopesDescriptor>True</VariablesToInnerScopesDescriptor><StringToTemplatesDescriptor>True</StringToTemplatesDescriptor><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><OptimizeImportsTs>True</OptimizeImportsTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><AsInsteadOfCastTs>True</AsInsteadOfCastTs><CssAlphabetizeProperties>True</CssAlphabetizeProperties><JsInsertSemicolon>True</JsInsertSemicolon><JsReformatCode>True</JsReformatCode><JsFormatDocComments>True</JsFormatDocComments><HtmlReformatCode>True</HtmlReformatCode><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><VBOptimizeImports>True</VBOptimizeImports><VBShortenReferences>True</VBShortenReferences><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CssReformatCode>True</CssReformatCode><VBReformatCode>True</VBReformatCode><VBFormatDocComments>True</VBFormatDocComments><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments></Profile> FilterLists Cleanup NEVER @@ -10,5 +7,9 @@ CHOP_IF_LONG CHOP_IF_LONG CHOP_IF_LONG + True + True + True + True True True \ No newline at end of file diff --git a/web/.dockerignore b/web/.dockerignore index 86561c20a..ff58e2c28 100644 --- a/web/.dockerignore +++ b/web/.dockerignore @@ -1,4 +1,5 @@ **/Dockerfile +**/debug.Dockerfile **/.dockerignore **/.gitignore **/azure-pipelines.yaml diff --git a/web/Dockerfile b/web/Dockerfile index 17e42f814..41ad9ed4e 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -2,8 +2,8 @@ FROM nginx:alpine as base COPY server/conf.d /etc/nginx/conf.d -# init install -FROM node:alpine as install +# init build +FROM node:alpine as build # https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md#node-gyp-alpine RUN apk add --no-cache python make g++ @@ -13,13 +13,8 @@ WORKDIR /usr/src/app/ COPY package*.json ./ RUN npm ci --only=production -# init build -FROM node:alpine as build -WORKDIR /usr/src/app/ -COPY --from=install /usr/src/app/node_modules ./node_modules - # build -COPY . . +COPY . ./ RUN npm run build # final diff --git a/web/debug.Dockerfile b/web/debug.Dockerfile new file mode 100644 index 000000000..5cb976b28 --- /dev/null +++ b/web/debug.Dockerfile @@ -0,0 +1,13 @@ +# init +FROM node:alpine +ENV PATH /app/node_modules/.bin:$PATH + +# install +RUN npm install react-scripts -g +WORKDIR /usr/src/app/ +COPY package*.json ./ +RUN npm install + +# start +COPY . ./ +CMD ["npm", "start"] \ No newline at end of file