-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Mavrik <mrricki.m.usmc@gmail.com>
- Loading branch information
1 parent
e13d7f9
commit 2f021de
Showing
17 changed files
with
168 additions
and
115 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
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,44 @@ | ||
ARG node_version=18.18 | ||
ARG node_image=node:${node_version} | ||
|
||
FROM $node_image AS builder | ||
|
||
COPY . /app/ | ||
|
||
ENV NEXT_TELEMETRY_DISABLED=1 | ||
ENV NODE_ENV=development | ||
|
||
WORKDIR /app | ||
RUN yarn --network-timeout 300000 | ||
WORKDIR /app/backend | ||
RUN yarn --network-timeout 300000 | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN yarn build | ||
WORKDIR /app | ||
RUN yarn build | ||
|
||
FROM node:${node_version}-alpine AS production | ||
|
||
WORKDIR /app | ||
|
||
ENV NODE_ENV=production | ||
RUN npm install --global pm2 | ||
RUN apk add -U nginx openssl | ||
|
||
COPY ./docker-assets /app/docker-assets/ | ||
RUN rm /etc/nginx/http.d/default.conf; \ | ||
ln -s /app/docker-assets/siren-http.conf /etc/nginx/http.d/siren-http.conf | ||
|
||
COPY --from=builder /app/backend/package.json /app/backend/package.json | ||
COPY --from=builder /app/backend/node_modules /app/backend/node_modules | ||
COPY --from=builder /app/backend/dist /app/backend/dist | ||
|
||
COPY --from=builder /app/siren.js /app/siren.js | ||
COPY --from=builder /app/package.json /app/package.json | ||
COPY --from=builder /app/node_modules /app/node_modules | ||
COPY --from=builder /app/public /app/public | ||
COPY --from=builder /app/.next /app/.next | ||
|
||
ENTRYPOINT /app/docker-assets/docker-entrypoint.sh |
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
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,22 @@ | ||
'use client' | ||
|
||
import { useTranslation } from 'react-i18next'; | ||
import Button, { ButtonFace } from '../../src/components/Button/Button'; | ||
import Typography from '../../src/components/Typography/Typography'; | ||
|
||
const Main = () => { | ||
const {t} = useTranslation() | ||
return ( | ||
<div className="relative space-y-12 z-50 w-96 -translate-x-96"> | ||
<div> | ||
<Typography darkMode="text-white" isBold color="text-white" type="text-h2">{t('errorPage.title')}</Typography> | ||
<Typography color="text-white" darkMode="text-white" type="text-subtitle3">{t('error.title')}</Typography> | ||
</div> | ||
<div> | ||
<Button href="/" type={ButtonFace.SECONDARY}>{t('errorPage.cta')}</Button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default Main |
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 was deleted.
Oops, something went wrong.
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,24 @@ | ||
#!/bin/bash | ||
|
||
set -a; \ | ||
. /app/.env; \ | ||
set +a | ||
|
||
if [ $SSL_ENABLED = true ] ; then | ||
## generate cert if not present | ||
if [ ! -f /certs/cert.pem ] ; then | ||
openssl req -x509 -newkey rsa:4096 -keyout /certs/key.pem -out /certs/cert.pem -days 365 -passout pass:'sigmaprime' -subj "/C=AU/CN=siren/emailAddress=noreply@sigmaprime.io" | ||
echo 'sigmaprime' > /certs/key.pass | ||
fi | ||
## nginx ssl stuff | ||
ln -s /app/docker-assets/siren-https.conf /etc/nginx/conf.d/siren-https.conf | ||
fi | ||
|
||
nginx & | ||
|
||
cd /app/backend | ||
yarn start & | ||
|
||
cd /app | ||
|
||
yarn dev |
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,24 @@ | ||
#!/bin/ash | ||
|
||
set -a; \ | ||
. /app/.env; \ | ||
set +a | ||
|
||
if [ $SSL_ENABLED = true ] ; then | ||
## generate cert if not present | ||
if [ ! -f /certs/cert.pem ] ; then | ||
mkdir -p /certs | ||
openssl req -x509 -newkey rsa:4096 -keyout /certs/key.pem -out /certs/cert.pem -days 365 -passout pass:'sigmaprime' -subj "/C=AU/CN=siren/emailAddress=noreply@sigmaprime.io" | ||
echo 'sigmaprime' > /certs/key.pass | ||
fi | ||
## nginx ssl stuff | ||
ln -s /app/docker-assets/siren-https.conf /etc/nginx/http.d/siren-https.conf | ||
fi | ||
|
||
nginx & | ||
|
||
cd /app/backend | ||
PM2_HOME='~/.pm2-backend' pm2-runtime yarn --interpreter sh -- start:prod & | ||
|
||
cd /app | ||
PM2_HOME='~/.pm2-frontend' pm2-runtime yarn --interpreter sh -- start |
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,7 @@ | ||
server { | ||
listen 80 default_server; | ||
|
||
location / { | ||
proxy_pass http://localhost:3000; | ||
} | ||
} |
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,13 @@ | ||
server { | ||
server_name _; | ||
listen 443 ssl; | ||
ssl_certificate /certs/cert.pem; | ||
ssl_certificate_key /certs/key.pem; | ||
ssl_password_file /certs/key.pass; | ||
ssl_protocols TLSv1.3; | ||
ssl_ciphers HIGH:!aNULL:!MD5; | ||
|
||
location / { | ||
proxy_pass http://localhost:3000; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.