Skip to content
Open
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
24 changes: 19 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ FROM node:latest

RUN apt update && apt upgrade -y

RUN apt install python sqlite3 libsqlite3-dev -y \
&& wget https://github.com/mapbox/node-sqlite3/archive/v4.1.1.zip -O /opt/sqlite3.zip \
&& mkdir -p /opt/sqlite3 \
&& unzip /opt/sqlite3.zip -d /opt/sqlite3 \
&& cd /opt/sqlite3/node-sqlite3-4.1.1 \
&& npm install \
&& ./node_modules/.bin/node-pre-gyp install --fallback-to-build --build-from-source --sqlite=/usr/bin --python=$(which python) \
&& mkdir -p /graphql/node_modules/sqlite3 \
&& mv /opt/sqlite3/node-sqlite3-4.1.1 /graphql/node_modules/sqlite3 \
&& apt remove python \
&& rm -Rf /opt/sqlite3 /opt/sqlite3.zip

# RUN yum module install -y nodejs

COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
Expand All @@ -10,17 +22,19 @@ RUN useradd -m app

COPY --chown=app ./app /graphql

WORKDIR /graphql
DEL /graphql/node_modules

ARG SERVER_PORT=3000
WORKDIR /graphql

ENV SERVER_PORT=${SERVER_PORT}
ENV SERVER_PORT=3000

EXPOSE ${SERVER_PORT}:${SERVER_PORT}
EXPOSE 3000:3000

RUN sed -i'' -e "s/%SERVER_PORT%/${SERVER_PORT}/g" /graphql/app.ts

RUN npm install sqlite3
#RUN npm config set python "$(which python3)"

#RUN npm install sqlite3

RUN npm install

Expand Down
2 changes: 1 addition & 1 deletion app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import cors from 'cors';


const app = express();
const port = %SERVER_PORT%;
const port = 3000;

app.use(cors());

Expand Down
Loading