Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9542507
added ability to enter a bldg into specific floor
dibaunaumh Oct 31, 2023
d426567
updating current resident nesting_depth when alicing in
dibaunaumh Nov 8, 2023
803a993
updated dependency to support new version of erlaang/otp
dibaunaumh Dec 16, 2023
81a9ce3
fix ssl error
dibaunaumh Dec 16, 2023
32a22cf
Added support for running locally using containers for both DB & server
dibaunaumh Dec 19, 2023
bd8155c
Added missing migration & fixed issues with running local containers
dibaunaumh Dec 20, 2023
625e4d1
added initial db dump
dibaunaumh Jan 10, 2024
6251690
WIP db initialization
dibaunaumh Jan 10, 2024
7c37535
fixed bug in exit bldg
dibaunaumh Jan 18, 2024
4e2412f
fixed bug in nesting-depth calculation
dibaunaumh Jan 23, 2024
651f811
after alicing out, stand just 2 steps away from bldg (not 6)
dibaunaumh Jan 31, 2024
c1f3b1b
fixing a bug when creating objects - y coord was updated but not the …
dibaunaumh Feb 6, 2024
dec9964
changing the distance from player when creating objects (2->4)
dibaunaumh Feb 7, 2024
eaaefbf
WIP Creating metadata for composite bldgs, to enable alicing into them
dibaunaumh Feb 8, 2024
12e1a47
tuning bldg height metadata
dibaunaumh Feb 8, 2024
ea8f04f
adding metadata for sales bldgs
dibaunaumh Feb 13, 2024
f59ae38
bldg metadata change
dibaunaumh Feb 20, 2024
fc1b92f
WIP updating containers to enable refresh when double-aliced-in
dibaunaumh Feb 23, 2024
c36cbd6
Updating containers to enable refresh when double-aliced-in
dibaunaumh Feb 23, 2024
6385555
WIP notifying on bldg creation
dibaunaumh Mar 24, 2024
fe8c34e
WIP notifying of created bldgs with blth url & address
dibaunaumh Mar 25, 2024
c7b18b9
WIP fixing issues where server crashes when creating objects from bat…
dibaunaumh Mar 25, 2024
5715593
changed metadata to match new client
dibaunaumh May 1, 2024
34b2117
protocol change: look now returns also the container bldg of the flr …
dibaunaumh May 1, 2024
f092198
metadata fix
dibaunaumh May 13, 2024
e4dadf3
WIP local dev from image
dibaunaumh May 15, 2024
33a5523
WIP local dev from image
dibaunaumh May 15, 2024
243bccf
running locally using containers downloaded
dibaunaumh May 16, 2024
34dd843
switched to using dev config in dockerfile, in order to support local…
dibaunaumh May 16, 2024
106f55a
limiting chat content to avoid overloading the visualization memory f…
dibaunaumh May 31, 2024
df31a83
add redis-server to bldg-server
dimaRaz Jun 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bldg_server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# ---- Build Stage ----
FROM elixir:1.11-alpine AS app_builder
FROM elixir:1.15-alpine AS app_builder

# Set environment variables for building the application
ENV MIX_ENV=prod \
ENV MIX_ENV=dev \
TEST=1 \
LANG=C.UTF-8

Expand Down Expand Up @@ -36,15 +36,15 @@ FROM alpine AS app
ENV LANG=C.UTF-8

# Install openssl
RUN apk add --update openssl ncurses-libs postgresql-client && \
RUN apk add --update bash openssl libgcc ncurses-libs postgresql-client libstdc++ && \
rm -rf /var/cache/apk/*


# Copy over the build artifact from the previous step and create a non root user
RUN adduser -D -h /home/app app
WORKDIR /home/app
COPY --from=app_builder /app/_build .
RUN chown -R app: ./prod
RUN chown -R app: ./dev
USER app


Expand Down
23 changes: 23 additions & 0 deletions bldg_server/Dockerfile.local-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Elixir + Phoenix
ARG EX_VERSION=1.15

FROM elixir:$EX_VERSION

# Install debian packages
RUN apt-get update
RUN apt-get install --yes build-essential inotify-tools postgresql-client

# Install Phoenix packages
ARG PHX_VERSION=1.5.6
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix archive.install hex phx_new $PHX_VERSION

# Install node
# RUN curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
# RUN bash nodesource_setup.sh
# RUN apt-get install --yes nodejs npm

WORKDIR /app
EXPOSE 4000
EXPOSE 4443
7 changes: 4 additions & 3 deletions bldg_server/config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use Mix.Config

# Configure your database
config :bldg_server, BldgServer.Repo,
username: "udi",
password: "",
username: System.get_env("DB_USER", "postgres"),
password: System.get_env("DB_PASSWORD", ""),
database: "bldg_server_dev",
hostname: "localhost",
hostname: System.get_env("DB_HOST", "db"),
show_sensitive_data_on_connection_error: true,
pool_size: 10

Expand All @@ -19,6 +19,7 @@ config :bldg_server, BldgServerWeb.Endpoint,
http: [port: 4000],
https: [port: 4443,
otp_app: :bldg_server,
cipher_suite: :strong,
keyfile: "priv/cert/localhost.key",
certfile: "priv/cert/localhost.cert"],
debug_errors: true,
Expand Down
4 changes: 2 additions & 2 deletions bldg_server/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use Mix.Config
# Configure your database
config :bldg_server, BldgServer.Repo,
username: "postgres",
password: "postgres",
password: System.get_env("DB_PASSWORD", "postgres"),
database: "bldg_server_test",
hostname: "localhost",
hostname: System.get_env("DB_HOST", "localhost"),
pool: Ecto.Adapters.SQL.Sandbox

# We don't run a server during test. If one is required,
Expand Down
199 changes: 199 additions & 0 deletions bldg_server/devops/db/initial_db_data.sql

Large diffs are not rendered by default.

55 changes: 34 additions & 21 deletions bldg_server/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@
version: '3.1'
version: "3.2"

services:

database:
db:
image: postgres
restart: always
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: bldg_server_prod
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- db_data:/var/lib/postgresql/data
POSTGRES_USER: postgres
POSTGRES_PASSWORD:
POSTGRES_HOST_AUTH_METHOD: trust
ports:
- "5432:5432"
volumes:
- ./devops/db/initial_db_data.sql:/docker-entrypoint-initdb.d/initial_db_data.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5

web:
image: bldg-server
restart: always
image: dibaunaumh/bldg-server:v063
volumes:
- type: bind
source: .
target: /app
ports:
- ${APP_PORT}:${APP_PORT}
environment:
APP_HOSTNAME: ${APP_HOSTNAME}
APP_PORT: ${APP_PORT}
DB_USER: ${DB_USER}
DB_PASSWORD: ${DB_PASSWORD}
DB_HOST: ${DB_HOST}
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
- "4000:4000"
- "4443:4443"
env_file: docker.env
depends_on:
- database
db:
condition: service_healthy
# command:
# - ./run.sh
redis:
image: redis
container_name: redis-server
ports:
- "6379:6379"
volumes:
- redis-data:/data

volumes:
db_data:
redis-data:
10 changes: 10 additions & 0 deletions bldg_server/docker.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
APP_HOSTNAME=localhost
APP_PORT=4443
DB_USER=postgres
DB_PASSWORD=
DB_HOST=db
DB_PORT=5432
DB_NAME=bldg_server_dev
DB_SSL=false
SECRET_KEY_BASE=notsecret
SENDGRID_API_KEY=notapikey
4 changes: 2 additions & 2 deletions bldg_server/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ do
done


./prod/rel/bldg_server/bin/bldg_server eval BldgServer.Release.migrate
./dev/rel/bldg_server/bin/bldg_server eval BldgServer.Release.migrate

./prod/rel/bldg_server/bin/bldg_server start
./dev/rel/bldg_server/bin/bldg_server start
Loading