Docker not working with SQLite database

I can't get docker to work with my sqlite database and ive tried a bunch of things with changing of files and such and it just doesnt work. My setup is php with apache. Here is my docker-compose file...
version: "3"

services:
apache:
build:
context: .
dockerfile: "./Dockerfile"
# Php site
volumes:
- .:/var/www/html


# SQL
- ./database/todoDB.sqlite3:/var/www/html/database/todoDB.sqlite3

ports:
- "8080:80"

environment:
- SQLITE_DATABASE_PATH=/var/www/db/todoDb.sqlite3

networks:
- backend

restart: always


networks:
backend:
driver: bridge
version: "3"

services:
apache:
build:
context: .
dockerfile: "./Dockerfile"
# Php site
volumes:
- .:/var/www/html


# SQL
- ./database/todoDB.sqlite3:/var/www/html/database/todoDB.sqlite3

ports:
- "8080:80"

environment:
- SQLITE_DATABASE_PATH=/var/www/db/todoDb.sqlite3

networks:
- backend

restart: always


networks:
backend:
driver: bridge
here is my dockerfile...
FROM debian:latest

RUN apt-get update -y && apt-get install -y apache2 locales-all micro php libapache2-mod-php php-sqlite3

COPY ./000-default.conf /etc/apache2/sites-available/000-default.conf

RUN a2ensite 000-default.conf
#RUN a2dissite 000-default

EXPOSE 80

# Create folder for SQLite
#RUN mkdir /var/www/db

#COPY ./database/todoDB.sqlite3 /var/www/db/todoDB.sqlite3
COPY ./database/todoDB.sqlite3 /var/www/html/todoDB.sqlite3

# Add permissions for writeable database
RUN chmod 777 /var/html/database/todoDB.sqlite3
#RUN chmod 777 /var/www/db
#RUN chmod 777 /var/www/db/todoDB.sqlite3


CMD ["apachectl", "-D", "FOREGROUND"]
FROM debian:latest

RUN apt-get update -y && apt-get install -y apache2 locales-all micro php libapache2-mod-php php-sqlite3

COPY ./000-default.conf /etc/apache2/sites-available/000-default.conf

RUN a2ensite 000-default.conf
#RUN a2dissite 000-default

EXPOSE 80

# Create folder for SQLite
#RUN mkdir /var/www/db

#COPY ./database/todoDB.sqlite3 /var/www/db/todoDB.sqlite3
COPY ./database/todoDB.sqlite3 /var/www/html/todoDB.sqlite3

# Add permissions for writeable database
RUN chmod 777 /var/html/database/todoDB.sqlite3
#RUN chmod 777 /var/www/db
#RUN chmod 777 /var/www/db/todoDB.sqlite3


CMD ["apachectl", "-D", "FOREGROUND"]
4 Replies
MD
MDOP10mo ago
here is my 000 config
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerAdmin admin@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
I have no clue what else is going on and I need to get through this issue because im going to need docker for upcoming projects.
MD
MDOP10mo ago
currently the project runs but if I try to add a task i get the following...
No description
MD
MDOP10mo ago
this happens after I click my add todo button
MD
MDOP10mo ago
No description
Want results from more Discord servers?
Add your server