Skip to content

Commit a0dcf0d

Browse files
committed
Add compose file, update readme
1 parent a88164e commit a0dcf0d

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

README.md

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
# Manual run
1+
# Deployment notes
22

3-
## Start app within a LAMP based image
3+
**Use the compose file in this repository to run the app.** From `~/omm-docker` run `docker-compose up -d`.
44

5-
- Start Docker LAMP
5+
As of March 2025, the production server is on OpenStack, and it runs the code **on the `add-google-analytics` branch**, not `main`.
66

7-
```
8-
docker run -i -t -p "80:80" -v ${PWD}/app:/app -v ${PWD}/mysql:/var/lib/mysql --restart=unless-stopped mattrayner/lamp:latest
9-
```
10-
11-
The command leverages mattrayner/lamp image to start a container running the LAMP stack. It expects a folder "app" at the directory where the command was run, where php code is stored.
12-
13-
The container will start a mysql database server, create a mysql folder at the directory where the command is run and mount that folder to var/lib/mysql inside the runnign container.
7+
The code in `/app` is **bind-mounted** to the container. Do not switch branches, edit code etc unless intentionally updating the production deployment.
148

15-
--restart=unless-stopped flag will automatically restart the container if it crashes, is stopped, or if the host machine reboots, ensuring that the application is always running unless it is explicitly stopped.
9+
## Create database
1610

17-
- Create database
1811
The app requires the database CreditCard to be created in order to function properly. Create it with
1912
```
2013
docker exec CONTAINER_ID mysql -uroot -e "create database CreditCard"

compose.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# run from ~/omm-docker: docker-compose up -d
2+
3+
services:
4+
lamp:
5+
image: mattrayner/lamp:0.8.0-1804-php8
6+
restart: unless-stopped
7+
ports:
8+
- "80:80"
9+
volumes:
10+
- /home/ubuntu/omm-docker/app:/app
11+
- web-omm-docker:/var/lib/mysql
12+
13+
backup:
14+
image: offen/docker-volume-backup:v2.43.0
15+
restart: always
16+
volumes:
17+
- web-omm-docker:/backup/web-omm-docker:ro
18+
environment:
19+
# Back up every day at 4:33am EDT/5:33am EST
20+
BACKUP_CRON_EXPRESSION: "33 9 * * *"
21+
BACKUP_RETENTION_DAYS: 365
22+
AWS_S3_BUCKET_NAME: sail-data-backups
23+
AWS_S3_PATH: web-omm-docker
24+
#AWS_ACCESS_KEY_ID: from env_file
25+
#AWS_SECRET_ACCESS_KEY: from env_file
26+
env_file: .aws-backup-secret-env
27+
28+
29+
volumes:
30+
web-omm-docker:
31+
external: true

0 commit comments

Comments
 (0)