Skip to content

Commit

Permalink
switch to phat node image for prod
Browse files Browse the repository at this point in the history
  • Loading branch information
antondlr authored and rickimoore committed Dec 17, 2024
1 parent d92383a commit 119fd09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ ARG node_image=node:${node_version}
FROM $node_image AS builder

ENV NEXT_TELEMETRY_DISABLED=1 \
NODE_ENV=production
NODE_ENV=development
WORKDIR /app
COPY . /app/

RUN yarn --network-timeout 300000; \
yarn build
NODE_ENV=production yarn build
WORKDIR /app/backend
RUN yarn --network-timeout 300000; \
yarn build
NODE_ENV=production yarn build

FROM alpine AS intermediate

Expand All @@ -27,14 +27,15 @@ COPY --from=builder /app/node_modules /app/node_modules
COPY --from=builder /app/public /app/public
COPY --from=builder /app/.next /app/.next

FROM node:${node_version}-alpine AS production
FROM $node_image AS production

ENV NODE_ENV=production
RUN npm install --global pm2; \
apk add --no-cache nginx openssl curl
apt update; \
apt install -y nginx openssl curl

RUN rm /etc/nginx/http.d/default.conf; \
ln -s /app/docker-assets/siren-http.conf /etc/nginx/http.d/siren-http.conf
RUN rm /etc/nginx/sites-enabled/default; \
ln -s /app/docker-assets/siren-http.conf /etc/nginx/conf.d/siren-http.conf

COPY --from=intermediate /app /app/

Expand Down
4 changes: 2 additions & 2 deletions docker-assets/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/ash
#!/bin/bash

# configure default vars if none provided
set -a
Expand Down Expand Up @@ -37,7 +37,7 @@ if [ $SSL_ENABLED = true ] ; 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
ln -s /app/docker-assets/siren-https.conf /etc/nginx/http.d/siren-https.conf
ln -s /app/docker-assets/siren-https.conf /etc/nginx/conf.d/siren-https.conf
fi


Expand Down

0 comments on commit 119fd09

Please sign in to comment.