Skip to content

Commit

Permalink
Reworked entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
mehallhm committed Nov 13, 2024
1 parent 49e5031 commit 31263ca
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# build environment
FROM node:22-alpine as build
FROM node:22-alpine AS build
WORKDIR /app

# Install deps
Expand Down Expand Up @@ -29,11 +29,11 @@ RUN rm -rf node_modules
# Get RDS Certificate
RUN apk update && apk add wget && rm -rf /var/cache/apk/* \
&& wget "https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem"
ENV dbCertPath /app/rds-ca-2019-root.pem
ENV dbCertPath=/app/rds-ca-2019-root.pem

ENV NODE_ENV=prod

ENTRYPOINT ["/app/entrypoint.sh"]

EXPOSE 4000 8080
CMD ["yarn", "prod"]
CMD ["node", "dist/graphql/index.js"]
4 changes: 3 additions & 1 deletion infrastructure/prod/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/sh

cd dist
yarn install --production
# TODO: This should be a `yarn workspaces focus --production` but
# the dev and non-dev deps are a tangled mess rn
yarn workspaces focus
yarn prod:db:migrate
yarn db:refresh
cd ..
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@
"dbtest": "jest -i --projects tests/database --verbose",
"about:unittest": "//// Runs unit tests. Does not need db, elasticsearch, spun up. Does not need the Docker containers to be running.",
"unittest": "jest -i --projects tests/unit --verbose",
"about:build_backend": "//// Compiles this project",
"build_backend": "rm -rf dist && mkdir -p dist && babel --extensions '.js,.ts' . -d dist/ --copy-files --ignore node_modules --ignore .git --include-dotfiles && rm -rf dist/.git",
"about:build": "//// Compiles this project, surpressing output",
"build": "yarn build_backend",
"about:build": "//// Compiles this project",
"build": "rm -rf dist && mkdir -p dist && babel --extensions '.js,.ts' . -d dist/ --copy-files --ignore node_modules --ignore .git --include-dotfiles && rm -rf dist/.git",
"about:prod:scrape": "//// Runs the scrapers (same as `yarn scrape`, but on the compiled project)",
"prod:scrape": "node dist/scrapers/main.js",
"about:prod": "//// Runs the API (same as `yarn dev`, but on the compiled project)",
Expand Down

0 comments on commit 31263ca

Please sign in to comment.