-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from Open-Model-Initiative/deployment-updates
Frontend Container | Environment Variable Updates
- Loading branch information
Showing
20 changed files
with
583 additions
and
84 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
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 |
---|---|---|
|
@@ -6,10 +6,12 @@ services: | |
POSTGRES_DB: ${POSTGRES_DB} | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
POSTGRES_HOST_AUTH_METHOD: trust | ||
POSTGRES_PORT: 35432 | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
ports: | ||
- "${POSTGRES_PORT:-35432}:5432" | ||
- 35432:5432 | ||
networks: | ||
- omi-network | ||
|
||
|
@@ -19,6 +21,15 @@ services: | |
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]} | ||
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin} | ||
PGADMIN_LISTEN_ADDRESS: 0.0.0.0 | ||
PGADMIN_CONFIG_SERVER_MODE: "False" | ||
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False" | ||
entrypoint: /bin/sh -c "chmod 600 /pgpass; /entrypoint.sh;" | ||
user: root | ||
configs: | ||
- source: servers.json | ||
target: /pgadmin4/servers.json | ||
- source: pgpass | ||
target: /pgpass | ||
volumes: | ||
- pgadmin_data:/var/lib/pgadmin | ||
ports: | ||
|
@@ -40,12 +51,67 @@ services: | |
- omi-network | ||
depends_on: | ||
- postgres | ||
develop: | ||
watch: | ||
- action: sync | ||
path: ./modules/odr_core | ||
target: /app/modules/odr_core | ||
- action: sync | ||
path: ./modules/odr_api | ||
target: /app/modules/odr_api | ||
- action: sync | ||
path: ./modules/odr_monitoring | ||
target: /app/modules/odr_monitoring | ||
|
||
odr-frontend: | ||
build: | ||
context: ./modules/odr_frontend | ||
dockerfile: docker/Dockerfile.frontend.dev | ||
volumes: | ||
- ./modules/odr_frontend:/app | ||
- odr_frontend_node_modules:/app/node_modules | ||
- odr_frontend_pnpm_store:/app/.pnpm-store | ||
ports: | ||
- "5173:5173" | ||
environment: | ||
NODE_ENV: development | ||
API_SERVICE_URL: http://odr-api:31100/api/v1 | ||
env_file: | ||
- ./modules/odr_frontend/.env | ||
networks: | ||
- omi-network | ||
develop: | ||
watch: | ||
- action: sync | ||
path: ./modules/odr_frontend | ||
target: /app | ||
ignore: | ||
- node_modules/ | ||
- .pnpm-store/ | ||
|
||
volumes: | ||
postgres_data: | ||
pgadmin_data: | ||
odr_frontend_node_modules: | ||
odr_frontend_pnpm_store: | ||
|
||
networks: | ||
omi-network: | ||
external: true | ||
driver: bridge | ||
|
||
configs: | ||
pgpass: | ||
content: postgres:35432:${POSTGRES_DB}:${POSTGRES_USER}:${POSTGRES_PASSWORD} | ||
servers.json: | ||
content: | | ||
{"Servers": {"1": { | ||
"Group": "Servers", | ||
"Name": "Open Data Repository", | ||
"Host": "postgres", | ||
"Port": 35432, | ||
"MaintenanceDB": "postgres", | ||
"Username": "${POSTGRES_USER}", | ||
"PassFile": "/pgpass", | ||
"SSLMode": "prefer" | ||
}}} |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Run the FastAPI server with uvicorn | ||
|
||
# Run the FastAPI server with multiple workers and log output to a file | ||
|
||
./venv/Scripts/python ./modules/odr_api/odr_api/main.py | ||
$env:PYTHONPATH = "." | ||
./venv/Scripts/uvicorn.exe odr_api.app:app --host 0.0.0.0 --port 31100 |
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 was deleted.
Oops, something went wrong.
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,5 @@ | ||
.git | ||
.gitignore | ||
npm-debug.log | ||
./docker/Dockerfile* | ||
.dockerignore |
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,21 @@ | ||
FROM node:22-alpine | ||
|
||
WORKDIR /app | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Copy package.json and pnpm-lock.yaml (if you have one) | ||
COPY package.json pnpm-lock.yaml* ./ | ||
|
||
# Copy the entrypoint script | ||
COPY docker/entrypoint.sh /entrypoint.sh | ||
RUN chmod +x /entrypoint.sh | ||
|
||
COPY template.env /app/.env | ||
|
||
EXPOSE 5173 | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
CMD ["pnpm", "run", "dev", "--", "--host", "0.0.0.0"] |
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,41 @@ | ||
# Build stage | ||
### STUB : Not verified #### | ||
FROM node:22-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Copy package.json and pnpm-lock.yaml (if you have one) | ||
COPY package.json pnpm-lock.yaml* ./ | ||
|
||
# Install dependencies | ||
RUN pnpm install --frozen-lockfile | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN pnpm run build | ||
|
||
# Production stage | ||
FROM node:22-alpine | ||
|
||
WORKDIR /app | ||
|
||
# Install pnpm | ||
RUN npm install -g pnpm | ||
|
||
# Copy built assets from the builder stage | ||
COPY --from=builder /app/build ./build | ||
COPY --from=builder /app/package.json . | ||
|
||
# Install only production dependencies | ||
RUN pnpm install --prod | ||
|
||
# Expose the application port | ||
EXPOSE 3000 | ||
|
||
# Start the application | ||
CMD ["node", "build"] |
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,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
echo "Installing dependencies..." | ||
pnpm install | ||
|
||
|
||
exec "$@" |
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
Oops, something went wrong.