Skip to content

Commit

Permalink
feat: update Dockerfile to fix deployment (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhruv-1001 authored Feb 1, 2024
1 parent 06b883e commit 6b272c4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
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

0 comments on commit 6b272c4

Please sign in to comment.