Skip to content

Commit bbb51ec

Browse files
committed
removed forever, added dep review and codeql workflows
1 parent 2debcb9 commit bbb51ec

6 files changed

Lines changed: 964 additions & 1454 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "Code analysis"
2+
on:
3+
push:
4+
branches: [ "master" ]
5+
pull_request:
6+
branches: [ "master" ]
7+
schedule:
8+
- cron: '0 8 * * *' # 8 am
9+
jobs:
10+
analyze:
11+
name: Analyze code
12+
runs-on: 'ubuntu-latest'
13+
permissions:
14+
security-events: write
15+
packages: read
16+
actions: read
17+
contents: read
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- language: actions
23+
build-mode: none
24+
- language: Javascript
25+
build-mode: none
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@v3
31+
with:
32+
languages: ${{ matrix.language }}
33+
build-mode: ${{ matrix.build-mode }}
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@v3
36+
with:
37+
category: "/language:${{matrix.language}}"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'Dependency scan'
2+
on: [pull_request]
3+
permissions:
4+
contents: read
5+
jobs:
6+
dependency-review:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: 'Checkout Repository'
10+
uses: actions/checkout@v4
11+
- name: 'Dependency Review'
12+
uses: actions/dependency-review-action@v4
13+
with:
14+
fail-on-severity: critical

Dockerfile

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
FROM node:20-bookworm-slim
22

3-
# This installs the necessary libs to make the bundled version of Chromium that Pupppeteer installs work
4-
RUN apt-get update \
5-
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq wget curl gnupg pdftk fontconfig fonts-liberation ca-certificates --no-install-recommends \
6-
# This installs the necessary libs to make the bundled version of Chromium that Puppeteer installs work
7-
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
8-
&& sh -c 'echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' \
9-
&& apt-get update \
10-
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq google-chrome-stable libxss1 --no-install-recommends \
11-
&& wget -O azcopy_v10.tar.gz https://aka.ms/downloadazcopy-v10-linux && tar -xf azcopy_v10.tar.gz --strip-components=1 && rm azcopy_v10.tar.gz \
12-
&& mv ./azcopy /usr/bin/ \
13-
&& rm -rf /var/lib/apt/lists/*
3+
RUN set -eux; \
4+
apt-get update; \
5+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
6+
ca-certificates curl gnupg wget pdftk fontconfig fonts-liberation supervisor; \
7+
install -d -m 0755 /etc/apt/keyrings; \
8+
curl -fsSL https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /etc/apt/keyrings/google-chrome.gpg; \
9+
chmod a+r /etc/apt/keyrings/google-chrome.gpg; \
10+
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/google-chrome.gpg] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list; \
11+
apt-get update; \
12+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends google-chrome-stable libxss1; \
13+
rm -rf /var/lib/apt/lists/*
14+
1415

1516
ENV WORK=/opt/publisher
1617
# ENV NODE_ENV production # Cannot use until devdependency list is fixed in package.json
@@ -28,18 +29,13 @@ COPY . ${WORK}
2829

2930
ARG BUILD_ENV=prod
3031
COPY .env.${BUILD_ENV} ${WORK}/.env
32+
COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
3133

3234
ARG DIGITRANSIT_APIKEY
3335
ENV DIGITRANSIT_APIKEY=${DIGITRANSIT_APIKEY}
3436
RUN yarn build
3537

3638
EXPOSE 4000
3739

38-
CMD \
39-
./fonts.sh && \
40-
fc-cache -f -v && \
41-
yarn run forever start -c "yarn serve" dist/ && \
42-
yarn run forever start -c "yarn server" ./ && \
43-
yarn run forever start -c "yarn worker" ./ && \
44-
sleep 3 && \
45-
yarn run forever -f logs 1
40+
CMD ./fonts.sh && fc-cache -f -v && exec supervisord -c /etc/supervisor/conf.d/supervisord.conf
41+

docker/supervisord.conf

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[supervisord]
2+
nodaemon=true
3+
logfile=/dev/null
4+
pidfile=/tmp/supervisord.pid
5+
6+
[program:serve]
7+
directory=/opt/publisher
8+
command=yarn serve
9+
autostart=true
10+
autorestart=true
11+
stdout_logfile=/dev/fd/1
12+
stdout_logfile_maxbytes=0
13+
stderr_logfile=/dev/fd/2
14+
stderr_logfile_maxbytes=0
15+
16+
[program:server]
17+
directory=/opt/publisher
18+
command=yarn server
19+
autostart=true
20+
autorestart=true
21+
stdout_logfile=/dev/fd/1
22+
stdout_logfile_maxbytes=0
23+
stderr_logfile=/dev/fd/2
24+
stderr_logfile_maxbytes=0
25+
26+
[program:worker]
27+
directory=/opt/publisher
28+
command=yarn worker
29+
autostart=true
30+
autorestart=true
31+
stdout_logfile=/dev/fd/1
32+
stdout_logfile_maxbytes=0
33+
stderr_logfile=/dev/fd/2
34+
stderr_logfile_maxbytes=0

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
"apollo-link-http": "^1.2.0",
8080
"bullmq": "^1.86.2",
8181
"dotenv": "^8.0.0",
82-
"forever": "^4.0.3",
8382
"fs-extra": "^8.1.0",
8483
"graphql": "^0.11.7",
8584
"graphql-tag": "^2.5.0",

0 commit comments

Comments
 (0)