Prajith04 commited on
Commit
4620832
·
verified ·
1 Parent(s): 581d9df

Upload 2 files

Browse files
Files changed (2) hide show
  1. docker-compose.yml +47 -0
  2. judge0.conf +358 -0
docker-compose.yml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ x-logging:
2
+ &default-logging
3
+ logging:
4
+ driver: json-file
5
+ options:
6
+ max-size: 100M
7
+
8
+ services:
9
+ server:
10
+ image: judge0/judge0:1.13.1
11
+ volumes:
12
+ - ./judge0.conf:/judge0.conf:ro
13
+ ports:
14
+ - "2358:2358"
15
+ privileged: true
16
+ <<: *default-logging
17
+ restart: always
18
+
19
+ workers:
20
+ image: judge0/judge0:1.13.1
21
+ command: ["./scripts/workers"]
22
+ volumes:
23
+ - ./judge0.conf:/judge0.conf:ro
24
+ privileged: true
25
+ <<: *default-logging
26
+ restart: always
27
+
28
+ db:
29
+ image: postgres:16.2
30
+ env_file: judge0.conf
31
+ volumes:
32
+ - data:/var/lib/postgresql/data/
33
+ <<: *default-logging
34
+ restart: always
35
+
36
+ redis:
37
+ image: redis:7.2.4
38
+ command: [
39
+ "bash", "-c",
40
+ 'docker-entrypoint.sh --appendonly no --requirepass "$$REDIS_PASSWORD"'
41
+ ]
42
+ env_file: judge0.conf
43
+ <<: *default-logging
44
+ restart: always
45
+
46
+ volumes:
47
+ data:
judge0.conf ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ################################################################################
2
+ # Judge0 Configuration File
3
+ ################################################################################
4
+ # Judge0 is a highly configurable which allows you to use it for many
5
+ # different use-cases. Please, before deploying Judge0 take a look at this
6
+ # configuration file that is divided in several logical sections that will help
7
+ # you understand what can you do with Judge0.
8
+ #
9
+ # This default configuration file is designed to work out of the box for you and
10
+ # you can start with it when deploying Judge0 on your server.
11
+ #
12
+ # If you have any questions please don't hasitate to send an email or open an
13
+ # issue on the GitHub page of the project.
14
+
15
+
16
+ ################################################################################
17
+ # Judge0 Server Configuration
18
+ ################################################################################
19
+ # Enable or disable Judge0 Telemetry.
20
+ # Read more about it here: https://github.com/judge0/judge0/blob/master/TELEMETRY.md
21
+ # Default: true
22
+ JUDGE0_TELEMETRY_ENABLE=
23
+
24
+ # Automatically restart Judge0 server if it fails to start.
25
+ # Default: 10
26
+ RESTART_MAX_TRIES=
27
+
28
+ # Maintenance mode is a mode in which clients cannot
29
+ # create or delete submissions while maintenance is enabled.
30
+ # Default: false
31
+ MAINTENANCE_MODE=
32
+
33
+ # Set custom maintenance message that will be returned to clients
34
+ # who try to create or delete submisions.
35
+ # Default: Judge0 is currently in maintenance.
36
+ MAINTENANCE_MESSAGE=
37
+
38
+ # If enabled user can request to synchronically wait for
39
+ # submission result on submission create.
40
+ # Default: true, i.e. user can request to wait for the result
41
+ ENABLE_WAIT_RESULT=
42
+
43
+ # If enabled user is allowed to set custom compiler options.
44
+ # Default: true
45
+ ENABLE_COMPILER_OPTIONS=
46
+
47
+ # List language names, separated by space, for which setting compiler options is allowed.
48
+ # Note that ENABLE_COMPILER_OPTIONS has higher priority, so this option will be
49
+ # ignored if setting compiler options is disabled with ENABLE_COMPILER_OPTIONS.
50
+ # For example, ALLOWED_LANGUAGES_FOR_COMPILER_OPTIONS="C C++ Java" would only
51
+ # allow setting compiler options for languages C, C++ and Java.
52
+ # Default: empty - for every compiled language setting compiler options is allowed.
53
+ ALLOWED_LANGUAGES_FOR_COMPILER_OPTIONS=
54
+
55
+ # If enabled user is allowed to set custom command line arguments.
56
+ # Default: true
57
+ ENABLE_COMMAND_LINE_ARGUMENTS=
58
+
59
+ # If enabled autorized users can delete a submission.
60
+ # Default: false
61
+ ENABLE_SUBMISSION_DELETE=
62
+
63
+ # If enabled user can GET and POST batched submissions.
64
+ # Default: true
65
+ ENABLE_BATCHED_SUBMISSIONS=
66
+
67
+ # Maximum number of submissions that can be created or get in a batch.
68
+ # Default: 20
69
+ MAX_SUBMISSION_BATCH_SIZE=
70
+
71
+ # If enabled user can use callbacks.
72
+ # Default: true
73
+ ENABLE_CALLBACKS=
74
+
75
+ # Maximum number of callback tries before giving up.
76
+ # Default: 3
77
+ CALLBACKS_MAX_TRIES=
78
+
79
+ # Timeout callback call after this many seconds.
80
+ # Default: 5
81
+ CALLBACKS_TIMEOUT=
82
+
83
+ # If enabled user can preset additional files in the sandbox.
84
+ # Default: true
85
+ ENABLE_ADDITIONAL_FILES=
86
+
87
+ # Duration (in seconds) of submission cache. Decimal numbers are allowed.
88
+ # Set to 0 to turn of submission caching. Note that this does not apply to
89
+ # batched submissions.
90
+ # Default: 1
91
+ SUBMISSION_CACHE_DURATION=
92
+
93
+ # If true the documentation page will be used as a homepage, otherwise, the
94
+ # homepage will be empty. You can always access the documentation page via /docs.
95
+ # Default: false
96
+ USE_DOCS_AS_HOMEPAGE=
97
+
98
+
99
+ ################################################################################
100
+ # Judge0 Workers Configuration
101
+ ################################################################################
102
+ # Specify polling frequency in seconds. Decimal numbers are allowed.
103
+ # Default: 0.1
104
+ INTERVAL=
105
+
106
+ # Specify how many parallel workers to run.
107
+ # Default: 2*nproc (https://linux.die.net/man/1/nproc)
108
+ COUNT=
109
+
110
+ # Specify maximum queue size. Represents maximum number of submissions that
111
+ # can wait in the queue at once. If request for new submission comes and the
112
+ # queue if full then submission will be rejected.
113
+ # Default: 100
114
+ MAX_QUEUE_SIZE=
115
+
116
+
117
+ ################################################################################
118
+ # Judge0 Server Access Configuration
119
+ ################################################################################
120
+ # Allow only specified origins.
121
+ # If left blank, then all origins will be allowed (denoted with '*').
122
+ # Example:
123
+ # ALLOW_ORIGIN="www.judge0.com judge0.com www.example.com blog.example.com"
124
+ ALLOW_ORIGIN=
125
+
126
+ # Disallow only specified origins.
127
+ # If left blank, then no origin will be disallowed.
128
+ # Example:
129
+ # DISALLOW_ORIGIN="www.judge0.com judge0.com www.example.com blog.example.com"
130
+ DISALLOW_ORIGIN=
131
+
132
+ # Allow only specified IP addresses.
133
+ # If left blank, then all IP addresses will be allowed.
134
+ # Example:
135
+ # ALLOW_IP="192.168.10.10 96.239.226.228 208.23.207.242"
136
+ ALLOW_IP=
137
+
138
+ # Disallow only specified IP addresses.
139
+ # If left blank, then no IP addresses will be disallowed.
140
+ # Example:
141
+ # DISALLOW_IP="192.168.10.10 96.239.226.228 208.23.207.242"
142
+ DISALLOW_IP=
143
+
144
+
145
+ ################################################################################
146
+ # Judge0 Authentication Configuration
147
+ ################################################################################
148
+ # You can protect your API with (AUTHN_HEADER, AUTHN_TOKEN) pair.
149
+ # Each request then needs to have this pair either in headers or
150
+ # query parameters. For example let AUTHN_HEADER=X-Judge0-Token and
151
+ # AUTHN_TOKEN=mySecretToken. Then user should authenticate by sending this
152
+ # in headers or query parameters in each request, e.g.:
153
+ # https://api.judge0.com/system_info?X-Judge0-Token=mySecretToken
154
+
155
+ # Specify authentication header name.
156
+ # Default: X-Auth-Token
157
+ AUTHN_HEADER=
158
+
159
+ # Specify valid authentication tokens.
160
+ # Default: empty - authentication is disabled
161
+ AUTHN_TOKEN=
162
+
163
+
164
+ ################################################################################
165
+ # Judge0 Authorization Configuration
166
+ ################################################################################
167
+ # Protected API calls can be issued with (AUTHZ_HEADER, AUTHZ_TOKEN) pair.
168
+ # To see exactly which API calls are protected with authorization tokens
169
+ # please read the docs at https://api.judge0.com.
170
+ # API authorization ensures that only specified users call protected API calls.
171
+ # For example let AUTHZ_HEADER=X-Judge0-User and AUTHZ_TOKEN=mySecretToken.
172
+ # Then user should authorize be sending this in headers or query parameters in
173
+ # each request, e.g.: https://api.judge0.com/system_info?X-Judge0-User=mySecretToken
174
+ # Note that if you enabled authentication, then user should also send valid
175
+ # authentication token.
176
+
177
+ # Specify authorization header name.
178
+ # Default: X-Auth-User
179
+ AUTHZ_HEADER=
180
+
181
+ # Specify valid authorization tokens.
182
+ # Default: empty - authorization is disabled, protected API calls cannot be issued
183
+ AUTHZ_TOKEN=
184
+
185
+
186
+ ################################################################################
187
+ # Redis Configuration
188
+ ################################################################################
189
+ # Specify Redis host
190
+ # Default: localhost
191
+ REDIS_HOST=redis
192
+
193
+ # Specify Redis port.
194
+ # Default: 6379
195
+ REDIS_PORT=
196
+
197
+ # Specify Redis password. Cannot be blank.
198
+ # Default: NO DEFAULT! MUST BE SET!
199
+ REDIS_PASSWORD=ULftPduQKfSFZPT9P8ZEsRHuzrAwsGEp
200
+
201
+
202
+ ################################################################################
203
+ # PostgreSQL Configuration
204
+ ################################################################################
205
+ # Specify Postgres host.
206
+ # Default: localhost
207
+ POSTGRES_HOST=db
208
+
209
+ # Specify Postgres port.
210
+ # Default: 5432
211
+ POSTGRES_PORT=
212
+
213
+ # Name of the database to use. Used only in production.
214
+ # Default: postgres
215
+ POSTGRES_DB=judge0
216
+
217
+ # User who can access this database. Used only in production.
218
+ # Default: postgres
219
+ POSTGRES_USER=judge0
220
+
221
+ # Password of the user. Cannot be blank. Used only in production.
222
+ # Default: NO DEFAULT, YOU MUST SET YOUR PASSWORD
223
+ POSTGRES_PASSWORD=rKvUfXK2DRqcku4KF3GbR7RtX5Uw7DDZ
224
+
225
+
226
+ ################################################################################
227
+ # Submission Configuration
228
+ ################################################################################
229
+ # Judge0 uses isolate as an sandboxing environment.
230
+ # Almost all of the options you see here can be mapped to one of the options
231
+ # that isolate provides. For more information about these options please
232
+ # check for the isolate documentation here:
233
+ # https://raw.githubusercontent.com/ioi/isolate/master/isolate.1.txt
234
+
235
+ # Default runtime limit for every program (in seconds). Decimal numbers are allowed.
236
+ # Time in which the OS assigns the processor to different tasks is not counted.
237
+ # Default: 5
238
+ CPU_TIME_LIMIT=
239
+
240
+ # Maximum custom CPU_TIME_LIMIT.
241
+ # Default: 15
242
+ MAX_CPU_TIME_LIMIT=
243
+
244
+ # When a time limit is exceeded, wait for extra time (in seconds), before
245
+ # killing the program. This has the advantage that the real execution time
246
+ # is reported, even though it slightly exceeds the limit.
247
+ # Default: 1
248
+ CPU_EXTRA_TIME=
249
+
250
+ # Maximum custom CPU_EXTRA_TIME.
251
+ # Default: 5
252
+ MAX_CPU_EXTRA_TIME=
253
+
254
+ # Limit wall-clock time in seconds. Decimal numbers are allowed.
255
+ # This clock measures the time from the start of the program to its exit,
256
+ # so it does not stop when the program has lost the CPU or when it is waiting
257
+ # for an external event. We recommend to use CPU_TIME_LIMIT as the main limit,
258
+ # but set WALL_TIME_LIMIT to a much higher value as a precaution against
259
+ # sleeping programs.
260
+ # Default: 10
261
+ WALL_TIME_LIMIT=
262
+
263
+ # Maximum custom WALL_TIME_LIMIT.
264
+ # Default: 20
265
+ MAX_WALL_TIME_LIMIT=
266
+
267
+ # Limit address space of the program in kilobytes.
268
+ # Default: 128000
269
+ MEMORY_LIMIT=
270
+
271
+ # Maximum custom MEMORY_LIMIT.
272
+ # Default: 512000
273
+ MAX_MEMORY_LIMIT=
274
+
275
+ # Limit process stack in kilobytes.
276
+ # Default: 64000
277
+ STACK_LIMIT=
278
+
279
+ # Maximum custom STACK_LIMIT.
280
+ # Default: 128000
281
+ MAX_STACK_LIMIT=
282
+
283
+ # Maximum number of processes and/or threads program can create.
284
+ # Default: 60
285
+ MAX_PROCESSES_AND_OR_THREADS=
286
+
287
+ # Maximum custom MAX_PROCESSES_AND_OR_THREADS.
288
+ # Default: 120
289
+ MAX_MAX_PROCESSES_AND_OR_THREADS=
290
+
291
+ # If true then CPU_TIME_LIMIT will be used as per process and thread.
292
+ # Default: false, i.e. CPU_TIME_LIMIT is set as a total limit for all processes and threads.
293
+ ENABLE_PER_PROCESS_AND_THREAD_TIME_LIMIT=
294
+
295
+ # If false, user won't be able to set ENABLE_PER_PROCESS_AND_THREAD_TIME_LIMIT.
296
+ # Default: true
297
+ ALLOW_ENABLE_PER_PROCESS_AND_THREAD_TIME_LIMIT=
298
+
299
+ # If true then MEMORY_LIMIT will be used as per process and thread.
300
+ # Default: false, i.e. MEMORY_LIMIT is set as a total limit for all processes and threads.
301
+ ENABLE_PER_PROCESS_AND_THREAD_MEMORY_LIMIT=
302
+
303
+ # If false, user won't be able to set ENABLE_PER_PROCESS_AND_THREAD_MEMORY_LIMIT.
304
+ # Default: true
305
+ ALLOW_ENABLE_PER_PROCESS_AND_THREAD_MEMORY_LIMIT=
306
+
307
+ # Limit size of files created (or modified) by the program in kilobytes.
308
+ # Default: 1024
309
+ MAX_FILE_SIZE=
310
+
311
+ # Maximum custom MAX_FILE_SIZE.
312
+ # Default: 4096
313
+ MAX_MAX_FILE_SIZE=
314
+
315
+ # Run each program this many times and take average of time and memory.
316
+ # Default: 1
317
+ NUMBER_OF_RUNS=
318
+
319
+ # Maximum custom NUMBER_OF_RUNS.
320
+ # Default: 20
321
+ MAX_NUMBER_OF_RUNS=
322
+
323
+ # Redirect stderr to stdout.
324
+ # Default: false
325
+ REDIRECT_STDERR_TO_STDOUT=
326
+
327
+ # Maximum total size (in kilobytes) of extracted files from additional files archive.
328
+ # Default: 10240, i.e. maximum of 10MB in total can be extracted.
329
+ MAX_EXTRACT_SIZE=
330
+
331
+ # If false, user won't be able to set ENABLE_NETWORK.
332
+ # Default: true, i.e. allow user to permit or deny network calls from the submission.
333
+ ALLOW_ENABLE_NETWORK=
334
+
335
+ # If true submission will by default be able to do network calls.
336
+ # Default: false, i.e. programs cannot do network calls.
337
+ ENABLE_NETWORK=
338
+
339
+
340
+ ################################################################################
341
+ # Rails Configuration
342
+ ################################################################################
343
+ # Specify Rails environment: production or development
344
+ # Default: production
345
+ RAILS_ENV=
346
+
347
+ # Specify maximum number of concurrent Rails threads.
348
+ # Default: nproc (https://linux.die.net/man/1/nproc)
349
+ RAILS_MAX_THREADS=
350
+
351
+ # Specify how many processes will be created for handing requests. Each process
352
+ # will aditionally create RAILS_MAX_THREADS threads.
353
+ # Default: 2
354
+ RAILS_SERVER_PROCESSES=
355
+
356
+ # Secret key base for production, if not set it will be randomly generated
357
+ # Default: randomly generated
358
+ SECRET_KEY_BASE=