Skip to content

Commit

Permalink
build: 👷 Include Docker deployment options - Forager can now be deplo…
Browse files Browse the repository at this point in the history
…yed with a Docker image
  • Loading branch information
CRBroughton committed Nov 15, 2023
1 parent f2d92e5 commit 68ed2d7
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
5 changes: 5 additions & 0 deletions .changeset/dull-timers-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"forager": patch
---

Include Docker deployment options - Forager can now be deployed with a Docker image
26 changes: 13 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM node:18.12.1
FROM alpine:latest

LABEL author="Craig Broughton"
LABEL author.email="[email protected]"
ARG FORAGER_VERSION=2.0.0

WORKDIR /app
RUN apk add --no-cache \
unzip \
ca-certificates

COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# download and unzip Forager
ADD https://github.com/CRBroughton/forager/releases/download/${FORAGER_VERSION}/forager-${FORAGER_VERSION}-linux.zip /tmp/forager.zip

ADD . .
RUN unzip /tmp/forager.zip -d forager
RUN cd forager && mv forager-${FORAGER_VERSION}-linux forager
RUN rm -rf /tmp/forager/zip

RUN npm i -g pnpm && pnpm i
EXPOSE 8080

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 4000

CMD ["npm", "run", "dev"]
# start Forager
CMD ["forager/forager", "serve", "--http=0.0.0.0:8090"]
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ This binary will provide both the back-end and front-end of the application.

For deployment of the application, see [Pocketbases Going to Production documentation](https://pocketbase.io/docs/going-to-production/).

### Docker

The Forager repository includes a `docker-compose.yml` file, enabling
quick deployment of Forager. Simply install Docker, clone the repository
and then run `docker compose up -d`.

## Manual Installation

Regardless of manual installation method, you will require the following to build Forager:
Expand Down
18 changes: 9 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
version: '3.8'
version: "3.8"

services:
ui:
container_name: vite-ui
build:
context: ./
dockerfile: Dockerfile
forager:
build: .
container_name: forager
environment:
- PUID=1000
- PGID=1000
volumes:
- ./:/app
- ./node_modules:/app/node_modules
- forager:/pb/pb_data
ports:
- '4000:4000'
- 8090:8090
restart: unless-stopped
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"pocketbase:serve": "cd db && go run main.go serve",
"pocketbase:seed":"cd db && go run main.go seed",
"pocketbase:types": "npx pocketbase-typegen --db ./db/pb_data/data.db --out ./src/pocketbase-types.ts",
"pocketbase:migrate": "cd db && go run main.go migrate",
"pocketbase:migrate:down": "cd db && go run main.go migrate down",
"pocketbase:migrate:create": "cd db && go run main.go migrate create",
"changeset": "npx changeset",
"changeset:status": "npx changeset status --verbose",
"changeset:version": "npx changeset version"
Expand Down

0 comments on commit 68ed2d7

Please sign in to comment.