1
0
mirror of https://github.com/barthuijgen/factorio-sites.git synced 2024-12-11 11:41:28 +02:00
factorio-sites/apps/blueprints
2024-11-19 23:09:47 +01:00
..
prisma feat: update schema 2022-12-06 00:49:48 +01:00
public fix: disable auto redirect 2022-11-14 13:07:47 +01:00
specs fix: solve test and lint errors, update github action usage 2022-11-14 11:24:18 +01:00
src Use storage url directly for render, instead of api 2024-11-19 23:09:47 +01:00
.eslintrc.json fix linting 2021-12-07 00:20:15 +01:00
babel-jest.config.json fix: tests owrk again, fixed factoriocode 2021-12-07 01:02:37 +01:00
gcp-storage-cors.json Add cors for factorio.tools to gcp bucket 2022-03-12 22:10:20 +01:00
index.d.ts Added several ways of generating images, factorioprints scraper and a lot of updates to the main site 2020-10-22 15:53:06 +02:00
jest.config.js fix: tests owrk again, fixed factoriocode 2021-12-07 01:02:37 +01:00
next-env.d.ts Upgrade next and nx, removed babel config, fixes 2021-12-03 10:32:10 +01:00
next.config.js Upgrade next and nx, removed babel config, fixes 2021-12-03 10:32:10 +01:00
README.md chore: Linting fixes 2021-03-29 00:11:42 +02:00
tsconfig.json chore: dependencies upgrades 2021-12-03 10:56:23 +01:00
tsconfig.spec.json Upgrade next and nx, removed babel config, fixes 2021-12-03 10:32:10 +01:00

Blueprints application

Setting up the project

  • Add a .env.local file to apps/blueprints/ with the following values
POSTGRES_DB=factorio-blueprints
POSTGRES_USER=factorio-blueprints
#POSTGRES_HOST=127.0.0.1
#POSTGRES_PASSWORD=local
STEAM_WEB_API_KEY=(optional, for steam login)
GOOGLE_APPLICATION_CREDENTIALS="full/path/to/json-key-file.json"
GCP_BLUEPRINT_STRINGS_BUCKET=blueprint-strings
GCP_BLUEPRINT_IMAGES_BUCKET=blueprint-images
  • Add a .env file to apps/blueprints/prisma with a database connection url like
DATABASE_URL="postgresql://factorio-blueprints:local@127.0.0.1:5432/factorio-blueprints"
  • Run DB migration
cd apps/blueprints && npx prisma migrate deploy --preview-feature
  • Run local app
nx serve

Deploying

  • docker build -t eu.gcr.io/factorio-sites/blueprints --file blueprints.Dockerfile .
  • docker tag eu.gcr.io/factorio-sites/blueprints eu.gcr.io/factorio-sites/blueprints:dev
  • docker push eu.gcr.io/factorio-sites/blueprints

Google cloud environment

If deploying nextjs assets to google storage, set cors options gsutil cors set ./gcp-storage-cors.json gs://bucket_name