-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add models and ingestion scripts Signed-off-by: 35C4n0r <[email protected]> * feat: improve table schema Signed-off-by: 35C4n0r <[email protected]> * fix: fix migration typo Signed-off-by: 35C4n0r <[email protected]> * ref: refactor db schema Signed-off-by: 35C4n0r <[email protected]> * chore: replace schema Signed-off-by: 35C4n0r <[email protected]> * chore: replace schema Signed-off-by: 35C4n0r <[email protected]> * feat: migrate codebase Signed-off-by: 35C4n0r <[email protected]> * feat: add create/search place APIs * feat: fix setup script * fix: docker image fix --------- Signed-off-by: 35C4n0r <[email protected]> Co-authored-by: 35C4n0r <[email protected]> Co-authored-by: Jay Kumar <[email protected]>
- Loading branch information
1 parent
a679623
commit 03f48cd
Showing
45 changed files
with
1,562 additions
and
894 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DATABASE_URL=postgresql://admin:[email protected]:5555/gis |
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 |
---|---|---|
|
@@ -49,3 +49,6 @@ src/.DS_Store | |
/src/geojson-data/ | ||
/src/geoquery.in.data/ | ||
db.mmdb | ||
|
||
|
||
.env |
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,79 +1,36 @@ | ||
#FROM node:18.16.1-alpine | ||
# | ||
#COPY setup.sh | ||
# | ||
#RUN apk add --no-cache bash | ||
#RUN npm i -g @nestjs/cli typescript ts-node | ||
# | ||
#COPY package*.json /tmp/app/ | ||
#RUN cd /tmp/app && npm install | ||
# | ||
#COPY . /usr/src/app | ||
#RUN cp -a /tmp/app/node_modules /usr/src/app | ||
#COPY ./wait-for-it.sh /opt/wait-for-it.sh | ||
#COPY ./startup.dev.sh /opt/startup.dev.sh | ||
#RUN sed -i 's/ | ||
#//g' /opt/wait-for-it.sh | ||
#RUN sed -i 's/ | ||
#//g' /opt/startup.dev.sh | ||
# | ||
#WORKDIR /usr/src/app | ||
#RUN cp env-example .env | ||
#RUN npx prisma generate | ||
#RUN npm run build | ||
# | ||
#CMD ["/opt/startup.dev.sh"] | ||
# | ||
#EXPOSE 3000 | ||
FROM node:18-slim as base | ||
RUN apt-get update -y && apt-get install -y openssl | ||
|
||
|
||
#FROM node:18.16.1-alpine | ||
# | ||
#WORKDIR /usr/src/app | ||
# | ||
#COPY . . | ||
# | ||
#RUN apt-get update && apt-get install -y curl && apt-get install -y git | ||
#CMD /bin/bash | ||
#COPY ./package*.json ./ | ||
#RUN ./setup.sh | ||
# | ||
#ENV NODE_ENV production | ||
#CMD ["npm", "i"] | ||
#CMD [ "npm", "run", "start:dev" ] | ||
# | ||
#EXPOSE 3000 | ||
|
||
|
||
FROM node:20.11.0-alpine | ||
|
||
# Set the working directory | ||
WORKDIR /usr/src/app | ||
|
||
# Install curl and git using apk | ||
RUN apk update && apk add --no-cache curl git | ||
|
||
RUN #npm config set registry http://registry.npmjs.org/ | ||
|
||
# Copy package files first for better caching of npm install | ||
COPY ./package*.json ./ | ||
|
||
# Install dependencies | ||
FROM base AS install | ||
WORKDIR /app | ||
COPY package*.json ./ | ||
RUN npm install | ||
|
||
# Copy the rest of the application code | ||
FROM base as build | ||
WORKDIR /app | ||
COPY prisma ./prisma/ | ||
COPY --from=install /app/node_modules ./node_modules | ||
RUN npx prisma generate | ||
COPY . . | ||
RUN npm run build | ||
|
||
# Convert setup.sh to Unix-style line endings (LF) | ||
RUN sed -i 's/\r$//' ./setup.sh | ||
|
||
|
||
# Run any additional setup script | ||
FROM base as data | ||
WORKDIR /app | ||
COPY --from=install /app/node_modules ./node_modules | ||
COPY . . | ||
RUN chmod +x ./setup.sh | ||
RUN ./setup.sh | ||
|
||
# Set environment variable | ||
ENV NODE_ENV production | ||
|
||
# Start the application | ||
CMD ["npm", "run", "start:dev"] | ||
FROM base | ||
WORKDIR /app | ||
COPY --from=build /app/node_modules ./node_modules | ||
COPY --from=build /app/dist ./dist | ||
COPY --from=build /app/package*.json ./ | ||
COPY --from=build /app/prisma ./prisma | ||
COPY --from=data /app/db.mmdb ./db.mmdb | ||
COPY --from=data /app/src/geojson-data ./src/geojson-data | ||
COPY ./src ./src | ||
COPY tsconfig.json ./tsconfig.json | ||
EXPOSE 3000 | ||
|
||
CMD ["npm", "run", "migrate:ingest:start:prod"] |
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,74 +1,9 @@ | ||
services: | ||
fusionauth: | ||
image: fusionauth/fusionauth-app:latest | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
environment: | ||
DATABASE_URL: jdbc:postgresql://postgres:5432/fusionauth | ||
DATABASE_ROOT_USERNAME: ${POSTGRES_USER} | ||
DATABASE_ROOT_PASSWORD: ${POSTGRES_PASSWORD} | ||
DATABASE_USERNAME: ${DATABASE_USERNAME} | ||
DATABASE_PASSWORD: ${DATABASE_PASSWORD} | ||
FUSIONAUTH_APP_MEMORY: ${FUSIONAUTH_APP_MEMORY} | ||
FUSIONAUTH_APP_RUNTIME_MODE: ${FUSIONAUTH_APP_RUNTIME_MODE} | ||
FUSIONAUTH_APP_URL: http://fusionauth:9011 | ||
FUSIONAUTH_APP_KICKSTART_FILE: /usr/local/fusionauth/kickstarts/kickstart.json | ||
env_file: | ||
- ./env-example | ||
volumes: | ||
- fa-config:/usr/local/fusionauth/config | ||
- ./kickstart:/usr/local/fusionauth/kickstarts | ||
networks: | ||
- default | ||
restart: unless-stopped | ||
ports: | ||
- 9011:9011 | ||
|
||
postgres: | ||
image: postgres:15.3-alpine | ||
geoquery: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
ports: | ||
- ${DATABASE_PORT}:5432 | ||
volumes: | ||
- ./.data/db:/var/lib/postgresql/data | ||
- "3000:3000" | ||
environment: | ||
POSTGRES_USER: ${DATABASE_USERNAME} | ||
POSTGRES_PASSWORD: ${DATABASE_PASSWORD} | ||
POSTGRES_DB: ${DATABASE_NAME} | ||
healthcheck: | ||
test: ['CMD-SHELL', 'pg_isready -U postgres'] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
shadow-postgres: | ||
image: postgres:15.3-alpine | ||
ports: | ||
- ${SHADOW_DATABASE_PORT}:5432 | ||
volumes: | ||
- ./.data/shadow-db:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: ${SHADOW_DATABASE_USERNAME} | ||
POSTGRES_PASSWORD: ${SHADOW_DATABASE_PASSWORD} | ||
POSTGRES_DB: ${SHADOW_DATABASE_NAME} | ||
|
||
cache: | ||
image: redis:6.2-alpine | ||
restart: always | ||
ports: | ||
- '${CACHE_PORT}:6379' | ||
command: redis-server --save 20 1 | ||
volumes: | ||
- cache:/data | ||
|
||
# api: | ||
# build: | ||
# context: . | ||
# dockerfile: Dockerfile | ||
# ports: | ||
# - 3000:3000 | ||
volumes: | ||
fa-config: | ||
cache: | ||
networks: | ||
default: | ||
DATABASE_URL: postgresql://admin:[email protected]:5555/gis |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.