Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update Dockerfile to fix deployment #55

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ See code example in the [server](./server/app.js) folder.

Run `./setup.sh`. This script will install bun and download required files to setup server
```sh
cd server
./setup.sh
```

Start Server
```sh
cd server
bun app.js
```

Expand Down
5 changes: 4 additions & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ WORKDIR /usr/src/app

COPY . .

RUN apt-get update && apt-get install -y \
curl
CMD /bin/bash
COPY ./package*.json ./bun.lockb ./
RUN bun install
RUN ./setup.sh

ENV NODE_ENV production

Expand Down
1 change: 0 additions & 1 deletion server/pickled_output.json

This file was deleted.

12 changes: 6 additions & 6 deletions setup.sh → server/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ fi
bun install

# Changing PWD to download geojson data using curl
mkdir server/geojson-data &> /dev/null
cd server/geojson-data
mkdir ./geojson-data &> /dev/null
cd geojson-data

curl -Lo INDIA_DISTRICT.geojson "https://github.com/datta07/INDIAN-SHAPEFILES/raw/master/INDIA/INDIA_DISTRICTS.geojson"
curl -Lo INDIA_SUBDISTRICT.geojson "https://github.com/datta07/INDIAN-SHAPEFILES/raw/master/INDIA/INDIAN_SUB_DISTRICTS.geojson"
Expand All @@ -43,12 +43,12 @@ mv ./or ./odisha
mv ./rj ./rajasthan
mv ./sk ./sikkim

# Changing PWD back to project root
cd ../../..
# Changing PWD back to /server/
cd ../..

# Updating geoJSON files through script to make them usable in server
cd server/scripts
cd scripts
bun parse.geojson.js

# Changing PWD back to project root
# Changing PWD back to /server/
cd - &> /dev/null
Loading