Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
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
32 changes: 27 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,47 @@
FROM ubuntu:18.04

# Environment variables
ENV NODE_VERSION 12.8.0
ENV NPM_VERSION 3.5.2
ENV NVM_DIR /usr/local/nvm
ENV NVM_VERSION 0.34.0
ENV PYTHON_VERSION 3.6.7-1~18.04
ENV PATH /jepostule/node_modules/.bin/:${PATH}
ENV DJANGO_SETTINGS_MODULE config.settings.local
ENV LANG C.UTF-8

RUN apt update -y && \
apt install -y python3 python3-pip postgresql-client-common npm
apt install -y \
python3=$PYTHON_VERSION \
python3-pip \
postgresql-client-common \
curl \
npm=$NPM_VERSION-0ubuntu4
RUN ln -s /usr/bin/python3 /usr/local/bin/python
RUN ln -s /usr/bin/pip3 /usr/local/bin/pip

# Install NVM
RUN mkdir $NVM_DIR
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v$NVM_VERSION/install.sh | bash

# Install NodeJS with NVM
RUN /bin/bash -c "source $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm use $NODE_VERSION"

WORKDIR /jepostule

# Install python requirements
COPY ./requirements/ ./requirements/
RUN pip install -r requirements/prod.txt

COPY . /jepostule
ENV PATH /jepostule/node_modules/.bin/:${PATH}
ENV DJANGO_SETTINGS_MODULE config.settings.local
ENV LANG C.UTF-8
EXPOSE 8000

# Install frontend requirements
RUN npm install --unsafe-perm

EXPOSE 8000

RUN mkdir -p /var/log/uwsgi
CMD uwsgi --module=config.wsgi:application \
--master \
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ On partner websites, the user can click on "Je Postule" buttons for each display
./manage.py consumetopics all
./manage.py dequeuedelayed

NodeJS version: `12.8.0` (see [`Dockerfile`](/Dockerfile) and [`package.json`](/package.json)).
Python requirements: see the [requirements](/requirements) folder. This project uses Python `3.6`.

### Install

#### System dependencies
Expand Down Expand Up @@ -139,7 +142,7 @@ Run unit tests with code coverage:

The home page should redirect you to the embed demo page (useful to test if your installation worked!).
To make it work, you must:
- create a client platform (see section [Create client platform](#create-client-platform))
- create a client platform (see section [Client platform creation](#client-platform-creation))
- add these parameters to the demo page URL: `client_id` and `client_secret`.

Example: `/embed/demo/?client_id=<client_id>&client_secret=<client_secret>`
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
"name": "jepostule",
"version": "0.0.1",
"engineStrict": true,
"engines": {
"node": "12.8.0"
},
"private": true,
"dependencies": {
"jquery-datetimepicker": "^2.5.21",
"yuglify": "^2.0.0",
Expand Down