2021-03-13 15:15:15 +01:00
|
|
|
# Blueprints application
|
2020-10-22 15:53:06 +02:00
|
|
|
|
2021-03-13 15:15:15 +01:00
|
|
|
## Setting up the project
|
2020-10-22 15:53:06 +02:00
|
|
|
|
2021-03-13 15:15:15 +01:00
|
|
|
- Add a `.env.local` file to apps/blueprints/ with the following values
|
2020-10-22 15:53:06 +02:00
|
|
|
|
2021-03-13 15:15:15 +01:00
|
|
|
```
|
|
|
|
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
|
|
|
|
```
|
2020-10-22 15:53:06 +02:00
|
|
|
|
2021-03-13 15:15:15 +01:00
|
|
|
- Add a `.env` file to apps/blueprints/prisma with a database connection url like
|
2020-10-22 15:53:06 +02:00
|
|
|
|
2021-03-13 15:15:15 +01:00
|
|
|
```
|
|
|
|
DATABASE_URL="postgresql://factorio-blueprints:local@127.0.0.1:5432/factorio-blueprints"
|
|
|
|
```
|
|
|
|
|
|
|
|
- Run DB migration
|
2021-01-07 14:09:56 +01:00
|
|
|
|
|
|
|
```
|
2021-03-13 15:15:15 +01:00
|
|
|
cd apps/blueprints && npx prisma migrate deploy --preview-feature
|
2021-01-07 14:09:56 +01:00
|
|
|
```
|
2021-03-13 15:15:15 +01:00
|
|
|
|
|
|
|
- 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`
|