-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
131 lines (121 loc) · 3.78 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
x-environment: &common-env
EXPOSED_VNC_PORT: ${EXPOSED_VNC_PORT:-7900}
IQDB_URL: ${IQDB_URL:-http://iqdb:5588}
SELENIUM_URL: ${SELENIUM_URL:-http://selenium:4444}
services:
foxtrove:
build:
context: ./
args:
HOST_UID: ${HOST_UID:-1000}
HOST_GID: ${HOST_GID:-1000}
DOCKER_RUN_AS_USER: ${DOCKER_RUN_AS_USER:-}
image: foxtrove
environment:
<<: *common-env
RAILS_SERVER_EXEC: bin/rails server -p ${EXPOSED_SERVER_PORT:-9000} -b 0.0.0.0 --pid /tmp/server.pid
ESBUILD_EXEC: >-
esbuild app/typescript/application.ts
--target=chrome111,firefox111,safari16
--bundle --sourcemap
--outdir=public/build --loader:.png=file
--entry-names=[name]-[hash] --metafile=public/build/manifest.json
--watch=forever --color=true
GOOD_JOB_EXEC: bundle exec good_job --queues=scraping:1;e6_iqdb:1;variant_generation:5;default:1;submission_download:5
volumes:
- .:/app
- ${REVERSER_DATA_PATH:-${FOXTROVE_DATA_PATH:-./data}}/active_storage:/app/public/storage
# Only requires a single file but would create it as a folder on initial setup
- ${REVERSER_DATA_PATH:-${FOXTROVE_DATA_PATH:-./data}}/db_data:/docker/db_data
depends_on:
- postgres
- iqdb
- selenium
ports:
- ${EXPOSED_SERVER_PORT:-9000}:${EXPOSED_SERVER_PORT:-9000}
command: foreman start --color
postgres:
image: postgres:16.4-alpine3.20
environment:
- POSTGRES_USER=reverser
- POSTGRES_DB=reverser_development
- POSTGRES_HOST_AUTH_METHOD=trust
volumes:
- ${REVERSER_DATA_PATH:-${FOXTROVE_DATA_PATH:-./data}}/db_data:/var/lib/postgresql/data
shm_size: 256mb
ports:
- ${EXPOSED_POSTGRES_PORT:-34518}:5432
healthcheck:
test: [CMD-SHELL, pg_isready -d reverser_development -U reverser]
interval: 10s
timeout: 5s
retries: 5
# Make the version file world readable. Will only happen on second boot when the data actually exists
entrypoint: [/bin/sh, -c, chmod -f +r /var/lib/postgresql/data/PG_VERSION || true && docker-entrypoint.sh postgres]
# By default the command is "postgres" but that wouldn't properly appended to the entrypoint anymore
command: ""
iqdb:
image: ghcr.io/e621ng/iqdb:d42a65ba35523eb46152744d68d8ff302c1c9f92
volumes:
- ${REVERSER_DATA_PATH:-${FOXTROVE_DATA_PATH:-./data}}/iqdb_data:/iqdb
selenium:
image: selenium/standalone-chrome:4.24.0-20240830
environment:
- SE_VNC_NO_PASSWORD=1
shm_size: 2gb
ports:
- ${EXPOSED_VNC_PORT:-7900}:7900
# Profiles for standalone things
rubocop:
image: foxtrove
volumes:
- .:/app
entrypoint: bundle exec rubocop
profiles:
- rubocop
yamllint:
build:
dockerfile_inline: |
FROM python:3.12-alpine3.20
RUN pip install yamllint==1.35.1
WORKDIR /app
volumes:
- .:/app
entrypoint: yamllint -c .github/yamllint.yml -s .
profiles:
- yamllint
csslint:
build:
dockerfile_inline: |
FROM node:20-alpine3.20
RUN npm install [email protected] [email protected] -g
WORKDIR /app
volumes:
- .:/app
entrypoint: stylelint "**/*.css" --config .github/.stylelintrc.json
profiles:
- csslint
tslint:
build:
dockerfile_inline: |
FROM node:20-alpine3.20
RUN npm install [email protected] -g
WORKDIR /app
volumes:
- .:/app
entrypoint: tsc --noEmit -p .github/tsconfig.json
profiles:
- tslint
tests:
image: foxtrove
environment:
<<: *common-env
VIPS_WARNING: "0"
volumes:
- .:/app
entrypoint: bundle exec rails test
depends_on:
postgres:
condition: service_healthy
profiles:
- tests