-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
__pycache__/ | ||
venv/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__pycache__/ | ||
*.pyc | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM python:3.8-buster | ||
|
||
RUN apt-get update &&\ | ||
apt-get install -y postgresql-client &&\ | ||
rm -rf /var/lib/apt/lists/ | ||
RUN pip install gunicorn | ||
WORKDIR /app | ||
COPY . /app | ||
RUN pip install -r requirements.txt | ||
|
||
CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
# wait-for-postgres.sh | ||
|
||
set -e | ||
|
||
host="$1" | ||
shift | ||
cmd="$@" | ||
|
||
until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$host" -U "postgres" -c '\q'; do | ||
>&2 echo "Postgres is unavailable - sleeping" | ||
sleep 1 | ||
done | ||
|
||
>&2 echo "Postgres is up - executing command" | ||
exec $cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: "2.2" | ||
|
||
services: | ||
backend: | ||
image: lecafard/when3meet_backend | ||
build: ./backend | ||
restart: unless-stopped | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
- postgres | ||
environment: | ||
- POSTGRES_CONNECTION=postgres://when3meet:${POSTGRES_PASSWORD}@postgres/when3meet | ||
frontend: | ||
image: lecafard/when3meet_frontend | ||
build: ./frontend | ||
restart: unless-stopped | ||
ports: | ||
- "80:80" | ||
depends_on: | ||
- backend | ||
postgres: | ||
image: postgres:13-alpine | ||
restart: unless-stopped | ||
environment: | ||
- POSTGRES_USER=when3meet | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_DB=when3meet | ||
volumes: | ||
- db:/var/lib/postgresql/data | ||
volumes: | ||
db: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM node:14 AS builder | ||
WORKDIR /app | ||
COPY package.json /app/ | ||
RUN yarn install | ||
COPY ./ /app/ | ||
RUN yarn build | ||
|
||
FROM nginx:1.19-alpine | ||
COPY --from=builder /app/build/ /usr/share/nginx/html | ||
COPY nginx.conf /etc/nginx/conf.d/default.conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
|
||
#charset koi8-r; | ||
#access_log /var/log/nginx/host.access.log main; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
location /api { | ||
rewrite /api/(.*) /$1 break; | ||
proxy_pass http://backend:8000; | ||
} | ||
error_page 404 /index.html; | ||
|
||
} |