Skip to content

Commit

Permalink
docs(docker): update docs to add docker deployment example to droplet
Browse files Browse the repository at this point in the history
  • Loading branch information
AmruthPillai committed Mar 14, 2022
1 parent 143a123 commit 4dc83c1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ TZ=UTC
SECRET_KEY=change-me

# URLs
PUBLIC_URL=http://localhost:3000
PUBLIC_SERVER_URL=http://localhost:3100
PUBLIC_URL=http://<SERVER-IP>
PUBLIC_SERVER_URL=http://<SERVER-IP>/api

# Database
POSTGRES_HOST=localhost
Expand Down
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ services:
container_name: server
env_file: .env
environment:
- PUBLIC_URL=http://<SERVER-IP>
- POSTGRES_HOST=postgres
depends_on:
- traefik
Expand All @@ -44,8 +43,6 @@ services:
image: amruthpillai/reactive-resume:client-latest
container_name: client
env_file: .env
environment:
- PUBLIC_SERVER_URL=http://<SERVER-IP>/api
depends_on:
- traefik
- server
Expand Down
12 changes: 7 additions & 5 deletions docs/docs/deployment/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ curl -L https://raw.githubusercontent.com/AmruthPillai/Reactive-Resume/main/.env
4. Edit the docker-compose.yml file you just pulled in and update the `<SERVER-IP>` placeholders to your server's public IP (or domain, if applicable). Also, update the `.env` file that was just created and change variables such as `PUBLIC_URL`, `PUBLIC_SERVER_URL` etc. For a clear understanding of what each of the environment variables mean, head over to [this section](/source-code/env-vars) of the docs.

To change the default port `80` to something else, say `3000`, just change the properties in docker-compose's traefik service:

```yml
traefik:
command:
...
command: ...
- --entrypoints.web.address=:3000
ports:
- 3000:3000
Expand All @@ -63,7 +62,10 @@ traefik:
docker compose up
```
<img width="853" alt="Screenshot 2022-03-14 at 10 08 50 AM" src="https://user-images.githubusercontent.com/1134738/158140209-f80eab18-1575-464c-b29d-ac788bd53e93.png">
<img
width="853"
alt="Screenshot 2022-03-14 at 10 08 50 AM"
src="https://user-images.githubusercontent.com/1134738/158140209-f80eab18-1575-464c-b29d-ac788bd53e93.png"
/>
Now, your application should be running on http://SERVER-IP.
4 changes: 4 additions & 0 deletions docs/docs/deployment/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ sidebar_position: 4
---

# Deployment

You should be able to deploy the app within minutes by following these guides.

- [Docker](/deployment/docker)
4 changes: 2 additions & 2 deletions docs/docs/source-code/env-vars.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The secret key can be a unique key, a randomly generated string that is used for
**Required**: `yes`
**Description:** URL through which app is accessible

**Default Value:** `http://localhost:3000`
**Default Value:** `http://localhost`

This URL would be used in features like link sharing functionality and authentication redirection. This points only to the client app, as the server would be running on `PORT 3100` always.

Expand All @@ -47,7 +47,7 @@ This URL would be used in features like link sharing functionality and authentic
**Required**: `yes`
**Description:** URL through which server is accessible

**Default Value:** `http://localhost:3100`
**Default Value:** `http://localhost/api`

This URL is used when export PDF functionality is used within the app and has to reach out to the server.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/source-code/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ The source code to Reactive Resume is available on [GitHub](https://github.com/A

In this section, I'll be going through the steps on how you can build the project on your local machine (or the cloud). You can choose one of two paths from here:

- [Docker](source-code/docker)
- [Local Build](source-code/local-build)
- [Docker](/source-code/docker)
- [Local Build](/source-code/local-build)

0 comments on commit 4dc83c1

Please sign in to comment.