Skip to content

Commit 38b7976

Browse files
committed
Experiment with python
1 parent 6f65325 commit 38b7976

File tree

124 files changed

+706
-9513
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+706
-9513
lines changed

.github/workflows/docker-image.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
name: Docker Image CI
1+
# name: Docker Image CI
22

3-
on:
4-
push:
5-
branches: [ "main" ]
6-
pull_request:
7-
branches: [ "main" ]
3+
# on:
4+
# push:
5+
# branches: [ "main" ]
6+
# pull_request:
7+
# branches: [ "main" ]
88

9-
jobs:
9+
# jobs:
1010

11-
build:
11+
# build:
1212

13-
runs-on: ubuntu-latest
13+
# runs-on: ubuntu-latest
1414

15-
steps:
16-
- uses: actions/checkout@v3
17-
- name: Build the Docker image
18-
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
15+
# steps:
16+
# - uses: actions/checkout@v3
17+
# - name: Build the Docker image
18+
# run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)

.gitignore

+3-38
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
1-
users.dat
2-
data/*
3-
4-
.idea/workspace.xml
5-
.idea/vcs.xml
6-
7-
HELP.md
8-
target/
9-
!.mvn/wrapper/maven-wrapper.jar
10-
!**/src/main/**/target/
11-
!**/src/test/**/target/
12-
13-
### STS ###
14-
.apt_generated
15-
.classpath
16-
.factorypath
17-
.project
18-
.settings
19-
.springBeans
20-
.sts4-cache
21-
22-
### IntelliJ IDEA ###
23-
*.iws
24-
*.iml
25-
*.ipr
26-
27-
### NetBeans ###
28-
/nbproject/private/
29-
/nbbuild/
30-
/dist/
31-
/nbdist/
32-
/.nb-gradle/
33-
build/
34-
!**/src/main/**/build/
35-
!**/src/test/**/build/
36-
37-
### VS Code ###
38-
.vscode/
1+
.venv
2+
venv
3+
**/__pycache__

.idea/.gitignore

-3
This file was deleted.

.idea/compiler.xml

-18
This file was deleted.

.idea/encodings.xml

-7
This file was deleted.

.idea/jarRepositories.xml

-20
This file was deleted.

.idea/misc.xml

-18
This file was deleted.

.idea/uiDesigner.xml

-124
This file was deleted.

.mvn/wrapper/maven-wrapper.jar

-57.4 KB
Binary file not shown.

.mvn/wrapper/maven-wrapper.properties

-2
This file was deleted.

Dockerfile

-23
This file was deleted.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Clarkson Open Source Institute
3+
Copyright (c) 2023-2024 Clarkson Open Source Institute
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
all:
2+
@echo "Available targets: format"
3+
4+
format:
5+
isort --profile black fsuvius
6+
black fsuvius

db/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
db.sqlite3

docker-compose.yml

+26-10
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
11
services:
2-
web:
3-
build: .
4-
container_name: fsuvius
2+
app:
3+
build:
4+
context: .
5+
dockerfile: docker/app.Dockerfile
6+
container_name: fsuvius_app
57
restart: unless-stopped
68
expose:
7-
- 8080
9+
- 8000
810
networks:
911
- web
1012
volumes:
11-
- ./data:/home/fsuvius/fsuvius/data
12-
deploy:
13-
resources:
14-
limits:
15-
cpus: '1.0'
16-
memory: 500M
13+
- db:/home/fsuvius/db
14+
environment:
15+
- HOST=fsu.cosi.clarkson.edu
16+
- SECRET_KEY=[_____CHANGEME_____]
17+
18+
proxy:
19+
build:
20+
context: .
21+
dockerfile: docker/proxy.Dockerfile
22+
container_name: fsuvius_proxy
23+
restart: unless-stopped
24+
expose:
25+
- 80
26+
networks:
27+
- web
28+
depends_on:
29+
- app
1730

1831
networks:
1932
web:
2033
external: true
34+
35+
volumes:
36+
db: {}

docker/app.Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM python:3.12-bookworm
2+
EXPOSE 8000
3+
RUN pip install django gunicorn
4+
RUN useradd --user-group --create-home fsu
5+
USER fsu
6+
WORKDIR /home/fsu
7+
COPY --chown=fsu:fsu ./fsuvius ./fsuvius
8+
RUN rm -f ./fsuvius/settings.py
9+
COPY --chown=fsu:fsu ./docker/settings.py ./fsuvius/settings.py
10+
COPY --chown=fsu:fsu ./manage.py .
11+
STOPSIGNAL SIGINT
12+
CMD ["gunicorn", "-w 4", "--threads=4", "-t 15", "-b 0.0.0.0:8000", "fsuvius.wsgi"]

docker/nginx.conf

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
server {
2+
listen 80 default_server;
3+
listen [::]:80 default_server;
4+
5+
server_name _;
6+
7+
location /static {
8+
root /var/www;
9+
}
10+
11+
location / {
12+
proxy_set_header Host $host;
13+
proxy_set_header X-Real-IP $remote_addr;
14+
proxy_pass http://app:8000;
15+
}
16+
}

0 commit comments

Comments
 (0)