Skip to content

Commit

Permalink
Update Docker configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
lowercasename committed Jul 1, 2024
1 parent c5141c7 commit edf113e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM node:18-alpine
FROM node:20-alpine
WORKDIR /app
RUN apk add --no-cache python3 build-base
ADD package.json pnpm-lock.yaml /app/
RUN npm install -g pnpm
RUN pnpm install
RUN pnpm install --prod
COPY . /app/
RUN cp config/config.example.toml config/config.toml
# Always exit 0 here because TSC will fail while we're migrating to TypeScript but
# not everything uses TypeScript
RUN pnpm run build; exit 0
Expand Down
3 changes: 3 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ services:
- mongo
ports:
- 3000:3000
volumes:
# Set the correct path to the config folder
- ./gathio-docker:/app/config
mongo:
image: mongo:latest
volumes:
Expand Down
32 changes: 29 additions & 3 deletions docs/running-gathio/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,37 @@ the subject](https://www.linode.com/docs/web-servers/nginx/use-nginx-reverse-pro
## Docker

The easiest way to run Gathio using Docker is by using the provided `docker-compose` configuration.
Ensure that the `node_modules` folder does not exist in the `gathio` directory before starting up the
Docker container.

Ensure that the `node_modules` folder does not exist in the `gathio` directory before
starting up the Docker container.

Create a directory on your system where you'll keep the Gathio configuration file. Copy the example
config file into this directory:

```
mkdir ~/docker/gathio-docker
cp config/config.example.toml ~/docker/gathio-docker/config.toml
```

Under the `volumes` section of the `docker-compose.yml` configuration, adjust the
configuration volume to match the folder you created:

```dockerfile
volumes:
- '/home/username/docker/gathio-docker:/app/config
```
Adjust any settings in the config file, especially the MongoDB URL, which should read as follows for the standard Dockerfile config, and the email service if you want
to enable it:
```
mail_service = "nodemailer"
mongodb_url = "mongodb://mongo:27017/gathio"
```
Finally, start the Docker stack:
```
cd gathio
docker-compose up -d --build
```
Expand Down

0 comments on commit edf113e

Please sign in to comment.