Skip to content

Commit

Permalink
fix adjustable word count env (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek authored Jan 5, 2024
1 parent 4fda65e commit d2f3901
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
!frontend/lang/
!frontend/public/
!frontend/src/
!frontend/.env.production
!frontend/.env.development
!frontend/index.html
!frontend/package-lock.json
!frontend/package.json
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,4 @@ jobs:
target: production
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_NLP_WORD_TAGGER_MAX_INPUT=600
labels: ${{ steps.meta.outputs.labels }}
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ FROM base as production_builder

# set build ENV
ENV MIX_ENV="prod"
# we need mode development, otherwise build command wont work as it needs bundling capabilities
# ENV NODE_ENV="production"

# Setting this env var will avoid warnings from the production config
# We could leave it as it as no effect on the build output
Expand Down Expand Up @@ -88,7 +86,8 @@ COPY lib lib
# Install npm packages:
COPY frontend/package.json frontend/package-lock.json ./frontend/
# RUN ls ./frontend >&2
RUN npm i --quiet --prefix frontend
# the build requires dev dependencies like vite to work. vite will create a production build.
RUN npm ci --quiet --prefix frontend
COPY frontend frontend

RUN npm run build --prefix frontend
Expand Down
4 changes: 1 addition & 3 deletions docker-compose-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ services:
build:
context: .
target: production
args:
- VITE_NLP_WORD_TAGGER_MAX_INPUT=600
environment:
DATABASE_URL: postgres://${DOCKER_COMPOSE_APP_PROD_DATABASE_USER:?}:${DOCKER_COMPOSE_APP_PROD_DATABASE_USER_PASSWORD:?}@${DOCKER_COMPOSE_APP_PROD_DATABASE_HOST:-postgres_prod}/${DOCKER_COMPOSE_APP_PROD_DATABASE_NAME:?}
# DATABASE_URL: postgres://${DOCKER_COMPOSE_APP_PROD_DATABASE_USER:?}:${DOCKER_COMPOSE_APP_PROD_DATABASE_USER_PASSWORD:?}@${DOCKER_COMPOSE_APP_PROD_DATABASE_HOST:-postgres_prod}/${DOCKER_COMPOSE_APP_PROD_DATABASE_NAME:?}
# Add the address of the database host, so that wordcharts can find the database, e.g. an ip address or a reference to another service in the docker-compose file
DATABASE_HOST: ${DOCKER_COMPOSE_APP_PROD_DATABASE_HOST:-postgres_prod}
# Add the database name that wordcharts should use, e.g. in this case we created and named the database `wordcharts_prod`
Expand Down
3 changes: 1 addition & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ services:
DEFAULT_LOCALE: ${DOCKER_COMPOSE_APP_DEFAULT_LOCALE:-en}
SECRET_KEY_BASE: ${DOCKER_COMPOSE_APP_SECRET_KEY_BASE:-NDliN2UzNjAzMTlmMWIxODZhNzRjMDIzMDY2OTQ5N2Q4NGU3MjUxZjM0YmI0ZGY1}
URL_PORT: ${DOCKER_COMPOSE_APP_URL_PORT:-4000}
NLP_WORD_TAGGER_MAX_INPUT: 1000
VITE_NLP_WORD_TAGGER_MAX_INPUT: 1000
NLP_WORD_TAGGER_MAX_INPUT: 600
NLP_WORD_TAGGER_SERVER_URL: "${DOCKER_COMPOSE_APP_NLP_WORD_TAGGER_SERVER_URL:-nlp-word-tagger-server}:${DOCKER_COMPOSE_TAGGER_SERVER_PORT_PUBLISHED:-8080}"
NLP_WORD_TAGGER_BASIC_AUTH_USER_NAME: ${DOCKER_COMPOSE_APP_NLP_WORD_TAGGER_BASIC_AUTH_USER_NAME:-admin}
NLP_WORD_TAGGER_BASIC_AUTH_USER_PASSWORD: ${DOCKER_COMPOSE_APP_NLP_WORD_TAGGER_BASIC_AUTH_USER_PASSWORD:-test}
Expand Down
1 change: 1 addition & 0 deletions frontend/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_NLP_WORD_TAGGER_MAX_INPUT=600
3 changes: 3 additions & 0 deletions frontend/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DO NOT INCLUDE SENSITIVE INFORMATION HERE, AS IT WILL BE BUNDLED

VITE_NLP_WORD_TAGGER_MAX_INPUT=600

0 comments on commit d2f3901

Please sign in to comment.