mirror of
https://github.com/barthuijgen/factorio-sites.git
synced 2024-12-04 10:44:44 +02:00
.. | ||
prisma | ||
public | ||
specs | ||
src | ||
.babelrc | ||
.eslintrc.json | ||
babel-jest.config.json | ||
gcp-storage-cors.json | ||
index.d.ts | ||
jest.config.js | ||
next-env.d.ts | ||
next.config.js | ||
README.md | ||
tsconfig.json | ||
tsconfig.spec.json |
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