-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: Add a docker-based dev environment
- Loading branch information
1 parent
dbdde49
commit 1f27981
Showing
9 changed files
with
99 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ on: | |
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
build-lint: | ||
name: Build and Lint | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:21-alpine | ||
|
||
RUN apk add --no-cache libc6-compat chromium runuser make g++ py3-pip linux-headers | ||
ENV PUPPETEER_SKIP_DOWNLOAD true | ||
ENV CHROME_PATH "/usr/bin/chromium-browser" | ||
ENV BROWSER_EXECUTABLE_PATH "/bin/start-chrome.sh" | ||
ENV BROWSER_USER_DATA_DIR="/tmp/chrome" | ||
|
||
WORKDIR /app | ||
ADD start-chrome.sh /bin | ||
RUN chmod +x /bin/start-chrome.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
version: "3.8" | ||
services: | ||
web: | ||
build: | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- data:/data | ||
- ..:/app | ||
ports: | ||
- 3000:3000 | ||
environment: | ||
REDIS_HOST: redis | ||
DATABASE_URL: "file:/data/db.db" | ||
command: | ||
- yarn | ||
- web | ||
working_dir: /app | ||
depends_on: | ||
prep: | ||
condition: service_completed_successfully | ||
redis: | ||
image: redis:7.2-alpine | ||
volumes: | ||
- redis:/data | ||
workers: | ||
build: | ||
dockerfile: Dockerfile.dev | ||
volumes: | ||
- data:/data | ||
- ..:/app | ||
working_dir: /app | ||
environment: | ||
REDIS_HOST: redis | ||
DATABASE_URL: "file:/data/db.db" | ||
# OPENAI_API_KEY: ... | ||
command: | ||
- yarn | ||
- workers | ||
depends_on: | ||
prep: | ||
condition: service_completed_successfully | ||
prep: | ||
build: | ||
dockerfile: Dockerfile.dev | ||
working_dir: /app | ||
environment: | ||
DATABASE_URL: "file:/data/db.db" | ||
volumes: | ||
- data:/data | ||
- ..:/app | ||
command: | ||
- /bin/sh | ||
- -c | ||
- "corepack enable && yarn install --immutable && yarn prisma:generate && yarn prisma:migrate:dev" | ||
|
||
volumes: | ||
redis: | ||
data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
|
||
set -x; | ||
id -u chrome &>/dev/null || adduser -S chrome; | ||
mkdir -p $BROWSER_USER_DATA_DIR; | ||
chown chrome $BROWSER_USER_DATA_DIR; | ||
runuser -u chrome -- $CHROME_PATH --no-sandbox $@; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. | ||
# yarn lockfile v1 | ||
|
||
|