Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
plutov committed Aug 14, 2024
1 parent 348fcbf commit bf6ecf3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ COPY --from=deps /app/node_modules ./node_modules
COPY --from=ui . .

ENV NODE_ENV=production
ARG NEXT_PUBLIC_CONSOLE_API_ADDR
ENV NEXT_PUBLIC_CONSOLE_API_ADDR=$NEXT_PUBLIC_CONSOLE_API_ADDR
ENV NEXT_PUBLIC_CONSOLE_API_ADDR=http://127.0.0.1:8080

RUN npm run build

Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,20 @@ And you should be able to access the UI on http://localhost:3000 (default basic
## Deployment
There are 3 parts that need to be deployed:
You can deploy individual services to any cloud provider:
- Go backend. It's packaged as a Docker container and can be deployed to any cloud provider.
- Next.js frontend. It's also packaged as a Docker container, but also can be deployed to Vercel or Netlify.
- [Optional] Postgres database. You can use managed Postgres services or deploy it yourself.
The demo service (links above) is deployed to Fly.io (Go, SQLite) and Vercel (Next.js) and are under the free tiers.
There is also a combined version of Go and Next.js in the same Docker container. You can run it with:
```
docker-compose -f compose-combined.yml up -d --build
```
### Environment Variables
API:
Expand Down
9 changes: 2 additions & 7 deletions compose-combined.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,18 @@ services:
additional_contexts:
api: ./api
ui: ./ui
args:
- NEXT_PUBLIC_CONSOLE_API_ADDR=http://127.0.0.1:8080
ports:
- "3000:3000"
- "8080:8080"
init: true
environment:
- LOG_LEVEL=debug
- DATABASE_TYPE=sqlite # postgres|sqlite
- DATABASE_URL=/data/db/formulosity.db
- DATABASE_URL=/data/sqlite3/formulosity.db
- SURVEYS_DIR=/data/surveys
- CONSOLE_API_ADDR=http://127.0.0.1:8080
- IRON_SESSION_SECRET=e75af92dffba8065f2730472f45f2046941fe35f361739d31992f42d88d6bf6c
- HTTP_BASIC_AUTH=user:pass
volumes:
- formulosity_db:/data/db
- ./api/surveys:/data/surveys

volumes:
formulosity_db:
- ./api/sqlite3:/data/sqlite3

0 comments on commit bf6ecf3

Please sign in to comment.