Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
MonkeyDo committed May 20, 2021
2 parents fbecb79 + 4eb03ca commit ad23adc
Show file tree
Hide file tree
Showing 71 changed files with 1,695 additions and 822 deletions.
4 changes: 2 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--
Before making a pull request, please:
1. Read the guidelines for contributing
1. Verify that your changes match our coding style
1. Fill out the requested information
2. Verify that your changes match our coding style
3. Fill out the requested information
-->

### Problem
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
uses: bahmutov/npm-install@v1

- name: Run linters
uses: wearerequired/lint-action@feature/pull_request_target
uses: wearerequired/lint-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Enable linters with auto-fix
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: node_js
node_js:
- "node"
- "lts/*"
- "10"

notifications:
email: false
Expand Down
29 changes: 15 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM metabrainz/node:10 as bookbrainz-base
FROM metabrainz/node:16 as bookbrainz-base

ARG DEPLOY_ENV
ARG GIT_COMMIT_SHA

ARG BUILD_DEPS=" \
build-essential \
python-dev \
libpq5 \
libpq-dev"

ARG RUN_DEPS=" \
Expand All @@ -22,7 +23,7 @@ RUN apt-get update && \
# PostgreSQL client
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
ENV PG_MAJOR 12
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main' $PG_MAJOR > /etc/apt/sources.list.d/pgdg.list
RUN apt-get update \
&& apt-get install -y --no-install-recommends postgresql-client-$PG_MAJOR \
&& rm -rf /var/lib/apt/lists/*
Expand All @@ -40,20 +41,15 @@ RUN chown bookbrainz:bookbrainz $BB_ROOT
RUN echo $GIT_COMMIT_SHA > .git-version

# Files necessary to complete the JavaScript build
COPY scripts/ scripts/
COPY .babelrc ./
COPY .eslintrc.js ./
COPY .eslintignore ./
COPY webpack.client.js ./
COPY package.json ./
COPY package-lock.json ./
COPY --chown=bookbrainz scripts/ scripts/
COPY --chown=bookbrainz .babelrc .eslintrc.js .eslintignore webpack.client.js package.json package-lock.json ./

RUN npm install --no-audit

COPY static/ static/
COPY config/ config/
COPY sql/ sql/
COPY src/ src/
COPY --chown=bookbrainz static/ static/
COPY --chown=bookbrainz config/ config/
COPY --chown=bookbrainz sql/ sql/
COPY --chown=bookbrainz src/ src/


# Development target
Expand Down Expand Up @@ -87,8 +83,10 @@ ADD ./docker/crontab /etc/cron.d/bookbrainz
RUN chmod 0644 /etc/cron.d/bookbrainz && crontab -u bookbrainz /etc/cron.d/bookbrainz

# Build JS project and assets
USER bookbrainz
RUN ["npm", "run", "build"]
RUN ["npm", "prune", "--production"]
USER root

# API target
FROM bookbrainz-base as bookbrainz-webservice
Expand All @@ -103,6 +101,9 @@ RUN chmod +x /etc/service/webserver/exec-command
COPY ./docker/$DEPLOY_ENV/webserver.service /etc/service/webserver/run
RUN chmod 755 /etc/service/webserver/run
RUN touch /etc/service/webserver/down

# Build API JS
USER bookbrainz
RUN ["npm", "run", "build-api-js"]
RUN ["npm", "prune", "--production"]
RUN ["npm", "prune", "--production"]
USER root
2 changes: 1 addition & 1 deletion NODEJS_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### These instruction are only valid for specific cases when you do not want to use Docker (`./develop.sh`) to run the server on your machine.

If for some reason you do not want to use our standard development environment (Docker), you can run the server code manually (
regardless of whether you are running dependencies (database, search,…) with Docker or you [are running them manually](./MANUAL_INSTALL.md))
regardless of whether you are running dependencies (database, search,…) with Docker or you [are running them manually](./DEPENDENCIES_MANUAL_INSTALL.md))

## Installing NodeJS

Expand Down
10 changes: 10 additions & 0 deletions config/config.json.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,15 @@
"password": "changeme"
},
"requestTimeout": 30000
},
"mailConfig" :{
"host":"",
"port":"",

"auth":{
"user":"",
"pass":""
}

}
}
Loading

0 comments on commit ad23adc

Please sign in to comment.