Skip to content

Commit

Permalink
Merge branch 'rust-og-injector'
Browse files Browse the repository at this point in the history
  • Loading branch information
CptnFizzbin committed Aug 11, 2024
2 parents 3bfe1b6 + 016655a commit 8a7b665
Show file tree
Hide file tree
Showing 482 changed files with 3,512 additions and 140 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import/
node_modules/

vendor/
dist/

.env
.volumes/
Expand Down
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/runConfigurations/Test_Client.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Development: Start (Build)" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<configuration default="false" name="Development - Start" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="envFilePath" value="" />
Expand All @@ -10,7 +10,7 @@
<option name="value" value="https://localhost:8080/images" />
</DockerEnvVarImpl>
<DockerEnvVarImpl>
<option name="name" value="SERVER_URL" />
<option name="name" value="server_url" />
<option name="value" value="https://localhost:8080/api" />
</DockerEnvVarImpl>
</list>
Expand All @@ -19,12 +19,10 @@
<option name="services">
<list>
<option value="router" />
<option value="server" />
<option value="client" />
</list>
</option>
<option name="sourceFilePath" value="docker-compose.yml" />
<option name="upRemoveOrphans" value="true" />
</settings>
</deployment>
<method v="2" />
Expand Down
9 changes: 4 additions & 5 deletions .run/Development_ Start.run.xml → .run/Prod - Start.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Development: Start" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<configuration default="false" name="Prod - Start" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="envFilePath" value="" />
Expand All @@ -10,20 +10,19 @@
<option name="value" value="https://localhost:8080/images" />
</DockerEnvVarImpl>
<DockerEnvVarImpl>
<option name="name" value="SERVER_URL" />
<option name="name" value="server_url" />
<option name="value" value="https://localhost:8080/api" />
</DockerEnvVarImpl>
</list>
</option>
<option name="commandLineOptions" value="--build" />
<option name="services">
<list>
<option value="router" />
<option value="server" />
<option value="client" />
</list>
</option>
<option name="sourceFilePath" value="docker-compose.yml" />
<option name="upRemoveOrphans" value="true" />
<option name="sourceFilePath" value="docker-compose.production.yml" />
</settings>
</deployment>
<method v="2" />
Expand Down
75 changes: 56 additions & 19 deletions docker-compose.production.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,68 @@
services:
router:
extends:
file: docker-compose.shared.yml
service: router
build: packages/router
depends_on:
- server
- og-injector
ports:
- "127.0.0.1:${APP_PORT}:443"
restart: always
volumes:
- ./.volumes/images:/opt/images:ro
- ./.volumes/client:/opt/client:ro
- "${SSL_CRT}:/opt/ssl/current.crt:ro"
- "${SSL_KEY}:/opt/ssl/current.key:ro"

server:
extends:
file: docker-compose.shared.yml
service: server
restart: always
build: packages/server
command: bin/rails s -p 3000 -b 0.0.0.0
volumes:
- ./.volumes/images:/opt/images:rw
depends_on:
- db
environment:
RAILS_ENV: "${APP_ENV}"

APP_HOST: "${APP_HOST}"
APP_URL: "${APP_URL}"
APP_NAME: "${APP_NAME}"

DB_HOST: db # internal docker host
DB_PORT: 5432
DB_NAME: "${DB_NAME}"
DB_USER: "${DB_USER}"
DB_PASS: "${DB_PASS}"

TOKEN_SECRET: "${TOKEN_SECRET}"

IMAGES_DIR: "/opt/images"

client:
extends:
file: docker-compose.shared.yml
service: client
build: packages/client
volumes:
- ./.volumes/client:/opt/client/dist:rw
environment:
NODE_ENV: "${APP_ENV}"
REACT_APP_ENV: "${APP_ENV}"
REACT_APP_SERVER_URL: "${APP_URL}/api"
command: yarn build

og-injector:
extends:
file: docker-compose.shared.yml
service: og-injector
restart: always
build: packages/og-injector-rust
volumes:
- ./.volumes/client:/opt/client:ro
environment:
APP_NAME: "${APP_NAME}"
APP_URL: "${APP_URL}"

SERVER_URL: "http://server:3000" # internal docker url

CLIENT_DIR: "/opt/client"

db:
extends:
file: docker-compose.shared.yml
service: db
restart: always
image: postgres:16
volumes:
- ./.volumes/db/pg16:/var/lib/postgresql/data:rw
environment:
POSTGRES_DB: "${DB_NAME}"
POSTGRES_USER: "${DB_USER}"
POSTGRES_PASSWORD: "${DB_PASS}"
64 changes: 0 additions & 64 deletions docker-compose.shared.yml

This file was deleted.

33 changes: 17 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
services:
router:
extends:
file: docker-compose.shared.yml
file: docker-compose.production.yml
service: router
ports:
- "${DEV_SERVER_PORT}:443"

server:
extends:
file: docker-compose.shared.yml
file: docker-compose.production.yml
service: server
volumes:
- ./server:/opt/server:rw
- ./packages/server:/opt/server:rw
- ./.volumes/images:/opt/images:rw
environment:
CLIENT_URL: "${DEV_CLIENT_URL}"
SERVER_URL: "${DEV_SERVER_URL}/api"
IMAGES_URL: "${DEV_SERVER_URL}/images"
SERVER_URL: "${DEV_ROUTER_URL}/api"
IMAGES_URL: "${DEV_ROUTER_URL}/images"
ports:
- "${DEV_SERVER_PORT}:3000"

client:
extends:
file: docker-compose.shared.yml
file: docker-compose.production.yml
service: client
volumes:
- ./client:/opt/client:rw
- ./packages/client:/opt/client:rw
- ./.volumes/client:/opt/client/dist:rw
- "${SSL_CRT}:/opt/ssl/current.crt:ro"
- "${SSL_KEY}:/opt/ssl/current.key:ro"
environment:
PORT: "${DEV_CLIENT_PORT}"
HTTPS: true
SSL_CRT_FILE: /opt/ssl/current.crt
SSL_KEY_FILE: /opt/ssl/current.key
REACT_APP_SERVER_URL: "${DEV_SERVER_URL}/api"
REACT_APP_SERVER_URL: "${DEV_ROUTER_URL}/api"
command: yarn start
ports:
- "${DEV_CLIENT_PORT}:3000"
- "${DEV_CLIENT_PORT}:${DEV_CLIENT_PORT}"

og-injector:
extends:
file: docker-compose.shared.yml
file: docker-compose.production.yml
service: og-injector
ports:
- "${DEV_INJECTOR_PORT}:3000"
volumes:
- ./og-injector:/opt/og-injector:rw
- ./packages/og-injector-rust/target/debug/og-injector-rust:/usr/bin/og-injector-rust:ro
- ./.volumes/client:/opt/client:ro
command: yarn watch

db:
extends:
file: docker-compose.shared.yml
file: docker-compose.production.yml
service: db
ports:
- "${DEV_DB_PORT}:5432"
13 changes: 0 additions & 13 deletions package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8a7b665

Please sign in to comment.