diff --git a/Dockerfile b/Dockerfile index df729d3..1627556 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index ed660f6..28d238b 100644 --- a/README.md +++ b/README.md @@ -260,7 +260,7 @@ 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. @@ -268,6 +268,12 @@ There are 3 parts that need to be deployed: 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: diff --git a/compose-combined.yml b/compose-combined.yml index c90da07..c771b18 100644 --- a/compose-combined.yml +++ b/compose-combined.yml @@ -7,8 +7,6 @@ services: additional_contexts: api: ./api ui: ./ui - args: - - NEXT_PUBLIC_CONSOLE_API_ADDR=http://127.0.0.1:8080 ports: - "3000:3000" - "8080:8080" @@ -16,14 +14,11 @@ services: 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