Skip to content
Merged
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
1 change: 0 additions & 1 deletion .github/workflows/deploy-to-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

jobs:
# We should add a job to run the tests first...

deploy:
name: Deploy to organisers.doesliverpool.com
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ node_modules/
.sqlite/
.env
out/
.idea/
email_pass
email_user
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# WorkFlow
The `master` branch is used purely for deploying to production. All work should be done on the `development` branch but branching off of it following the naming scheme `<feature>/<issue_number>-<name>`, for example, `feature/58-fix-test-environment`

# LocalHosting/Testing
To run the project through docker, 'email_user' and 'email_pass' files need to exist in the root directory, populated only be a valid email address that can recieve emails and dummy password. You should copy the '.test.env' file into a proper '.env' file and populate it for the docker compose file to inherit the values.

Ensure that the file permissions for the project matches the permissiond defined in the 'docker-compose.yml' file and ensure that the database is populated and migrated properly by running
'docker-compose exec api npx knex seed:run --env production'
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ The `bootstrap` folder contains the site scss file (optimism.scss) and a subfold
For production we're running the `api` and `website` components as separate Docker containers, with an off-the-shelf Postgres container to provide the database.

Their interactions are orchestrated with `docker compose`, so getting it running should just be a case of running:
* `docker-compose build`
* `docker-compose up`
* `docker compose build`
* `docker compose up`

For the email username and password, the docker compose setup expects two files `email_user` and `email_pass` in the root folder.

To run any database migrations, once things are running then run: `docker-compose exec api npx knex migrate:latest --env production`
To run any database migrations, once things are running then run: `docker compose exec api npx knex migrate:latest --env production`

Any time things are pushed to the `master` branch, the [live site will automatically deploy the new version](https://github.com/DoESLiverpool/optimism/issues/48).

Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
db:
image: postgres
image: postgres:17.10-bookworm
container_name: optimism_db
environment:
POSTGRES_PASSWORD: topsecret
Expand All @@ -19,6 +19,7 @@ services:
OPTIMISM_SMTP_PORT: "587"
OPTIMISM_SMTP_SECURE: "false"
container_name: optimism_api
user: "${UID-1000}:${GID-1000}"
ports:
- 127.0.0.1:3001:3001
links:
Expand All @@ -33,6 +34,7 @@ services:
args:
OPTIMISM_API_CLIENT_SIDE_URL: "http://localhost:3001/api"
container_name: optimism_website
user: "${UID-1000}:${GID-1000}"
ports:
- 127.0.0.1:3000:3000
links:
Expand Down
2 changes: 1 addition & 1 deletion website/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Simple docker setup for the web server
FROM node:16
FROM node:20-alpine

EXPOSE 3001

Expand Down
Loading