Skip to content

Commit

Permalink
Merge pull request #3 from MesseBasseProduction/develop
Browse files Browse the repository at this point in the history
Release v0.1.0 - Core
  • Loading branch information
Asiberus authored Apr 11, 2023
2 parents c982786 + 1ce114f commit a13ce51
Show file tree
Hide file tree
Showing 409 changed files with 41,723 additions and 12,828 deletions.
26 changes: 26 additions & 0 deletions .conf/development/back/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:3.9-alpine

ENV PYTHONUNBUFFERED=1

WORKDIR /back

COPY ./.conf/development/back/run.sh /scripts/run.sh
ENV PATH="/scripts:$PATH"

COPY ./back/requirements.txt .

RUN apk add --update --no-cache postgresql-client zlib-dev jpeg-dev libwebp-dev && \
apk add --update --no-cache --virtual .tmp-deps \
build-base postgresql-dev musl-dev linux-headers && \
pip install -r requirements.txt && \
apk del .tmp-deps && \
adduser --disabled-password --no-create-home back && \
mkdir -p /vol/static && \
mkdir -p /vol/media && \
chmod -R +x /scripts

COPY ./back .

# TODO : Set user back, was removed for the collectstatic command to run succesfully
#USER back
CMD ["run.sh"]
10 changes: 10 additions & 0 deletions .conf/development/back/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

BACKEND_PORT=${BACKEND_PORT}
set -e

python manage.py wait_for_db
python manage.py collectstatic --noinput
python manage.py migrate

python manage.py runserver 0.0.0.0:$BACKEND_PORT
7 changes: 7 additions & 0 deletions .conf/development/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM nginx:1.22.0-alpine-perl

ENV NGINX_ENVSUBST_TEMPLATE_SUFFIX=.tpl

COPY ./.conf/development/nginx/default.conf.tpl /etc/nginx/templates/default.conf.tpl

CMD ["nginx", "-g", "daemon off;"]
21 changes: 21 additions & 0 deletions .conf/development/nginx/default.conf.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
server {
listen ${SERVER_HTTP_PORT};
listen [::]:${SERVER_HTTP_PORT};

location /static {
alias /vol/static;
}

location /media {
alias /vol/media;
}

location / {
proxy_pass http://${BACKEND_NAME}:${BACKEND_PORT};
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
}
31 changes: 31 additions & 0 deletions .conf/production/back/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM python:3.9-alpine

ENV PYTHONUNBUFFERED=1

WORKDIR /back

COPY ./.conf/production/back/run.sh /scripts/run.sh
ENV PATH="/scripts:$PATH"

COPY ./back/requirements.txt .

RUN apk add --update --no-cache postgresql-client zlib-dev jpeg-dev libwebp-dev && \
apk add --update --no-cache --virtual .tmp-deps \
build-base postgresql-dev musl-dev linux-headers && \
pip install -r requirements.txt && \
apk del .tmp-deps && \
adduser --disabled-password --no-create-home back && \
mkdir -p /vol/media && \
mkdir -p /vol/static && \
chmod -R +x /scripts

COPY ./back .
COPY ./static /back/static

RUN chown -R back:back /vol && \
chmod -R 755 /vol && \
chown -R back:back /back && \
chmod -R 755 /back

USER back
CMD ["run.sh"]
10 changes: 10 additions & 0 deletions .conf/production/back/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

BACKEND_PORT=${BACKEND_PORT}
set -e

python manage.py wait_for_db
python manage.py collectstatic --noinput
python manage.py migrate

uwsgi --socket :"$BACKEND_PORT" --workers 4 --master --enable-threads --module back.wsgi
12 changes: 12 additions & 0 deletions .conf/production/nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM nginx:1.22.0-alpine-perl

ENV NGINX_ENVSUBST_TEMPLATE_SUFFIX=.tpl

COPY ./.conf/production/nginx/default.conf.tpl /etc/nginx/templates/default.conf.tpl
COPY ./.conf/production/nginx/uwsgi_params /etc/nginx/uwsgi_params

RUN mkdir -p /var/log/nginx/back && \
touch /var/log/nginx/back/access.log && \
touch /var/log/nginx/back/error.log

CMD ["nginx", "-g", "daemon off;"]
21 changes: 21 additions & 0 deletions .conf/production/nginx/default.conf.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
server {
listen ${SERVER_PORT};
server_name ${SERVER_HOST};

access_log /var/log/nginx/back/access.log;
error_log /var/log/nginx/back/error.log warn;

location / {
uwsgi_pass ${BACKEND_PROXY};
include /etc/nginx/uwsgi_params;
client_max_body_size 10M;
}

location /static {
alias /vol/static;
}

location /media {
alias /vol/media;
}
}
13 changes: 13 additions & 0 deletions .conf/production/nginx/uwsgi_params
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
uwsgi_param QUERY_STRING $query_string;
uwsgi_param REQUEST_METHOD $request_method;
uwsgi_param CONTENT_TYPE $content_type;
uwsgi_param CONTENT_LENGTH $content_length;
uwsgi_param REQUEST_URI $request_uri;
uwsgi_param PATH_INFO $document_uri;
uwsgi_param DOCUMENT_ROOT $document_root;
uwsgi_param SERVER_PROTOCOL $server_protocol;
uwsgi_param REMOTE_ADDR $remote_addr;
uwsgi_param REMOTE_PORT $remote_port;
uwsgi_param SERVER_ADDR $server_addr;
uwsgi_param SERVER_PORT $server_port;
uwsgi_param SERVER_NAME $server_name;
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
node_modules
.idea
.DS_Store

*.py[cod]
*$py.class

back/tmp/
node_modules/
__pycache__/

static/dist/*.js
static/dist/*.css
.conf/development/conf.env
.conf/production/conf.env
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# BeerCrackerz

The website for beer lover, to share the best spot to crack a beer, or to easily refill this beverage of the gods!
Soon enough an alpha will be open for you to test this !
[![License](https://img.shields.io/github/license/MesseBasseProduction/BeerCrackerz.svg)](https://github.com/MesseBasseProduction/BeerCrackerz/blob/master/LICENSE.md)
![](https://badgen.net/badge/version/0.1.0/blue)

https://github.com/pointhi/leaflet-color-markers
Welcome, fellow beer lovers. BeerCrackerz is a community web app to list the best spots to drink a fresh one while you're outside. It provides a well-known map interface so it is really easy to browse, find or add unique spots!

https://leafletjs.com/
You want to try it ? We are currently running an instance just so you can try (and add your personnal best places) :

https://www.svgrepo.com/svg/287438/info
[https://beercrackerz.org](https://beercrackerz.org)

https://github.com/Leaflet/Leaflet.markercluster
## Get Started

In order to install BeerCrackerz on your system and run your own instance, please refer the the [**Installation**](https://github.com/MesseBasseProduction/BeerCrackerz/wiki) wiki entry.

## About

BeerCrackerz is an open-source software edited and hosted by [Messe Basse Production](https://messe-basse-production.com/), developper by [Arthur Beaulieu](https://github.com/ArthurBeaulieu) and [Raphaël Beekmann](https://github.com/Asiberus)

#### Technologies

[OpenStreetMap](https://www.openstreetmap.org/), [ESRI](https://www.esri.com), [LeafletJs](https://leafletjs.com/), [Leaflet-MarkerCluster](https://github.com/Leaflet/Leaflet.markercluster), [Leaflet-Color-Markers](https://github.com/pointhi/leaflet-color-markers), [SVGRepo](https://www.svgrepo.com/)
65 changes: 0 additions & 65 deletions ROADMAP.md

This file was deleted.

Loading

0 comments on commit a13ce51

Please sign in to comment.