1
0
mirror of https://github.com/barthuijgen/factorio-sites.git synced 2024-12-11 11:41:28 +02:00
factorio-sites/apps/blueprints/README.md

46 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

# 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`
2021-03-29 00:11:42 +02:00
## Google cloud environment
If deploying nextjs assets to google storage, set cors options
gsutil cors set ./gcp-storage-cors.json gs://bucket_name