mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-12 07:56:34 -04:00
Add Dockerfile. Ospos is now containerized. Pull image from
docker build -t me/ospos git://github.com/jekkos/opensourcepos.git
then run
docker run -it me/opensourcepos
And head to port 80 to login to a new ospos install.
This commit is contained in:
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM jbfink/docker-lampstack
|
||||
MAINTAINER jekkos
|
||||
# Install dependencies
|
||||
RUN apt-get install -y --no-install-recommends software-properties-common
|
||||
RUN apt-get install -y python git
|
||||
RUN apt-get update
|
||||
# RUN add-apt-repository ppa:chris-lea/node.js
|
||||
|
||||
# Get latest Ospos source from Git
|
||||
RUN git clone https://github.com/jekkos/opensourcepos.git /app
|
||||
# RUN cd app && npm install
|
||||
|
||||
RUN ln -fs /app/* /var/www
|
||||
ADD ./start_container.sh /start_container.sh
|
||||
RUN chmod 755 /start_container.sh
|
||||
EXPOSE 80 3306
|
||||
CMD ["/bin/bash", "/start_container.sh"]
|
||||
16
start_container.sh
Normal file
16
start_container.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
if [ ! -f /mysql-configured ]; then
|
||||
/usr/bin/mysqld_safe &
|
||||
sleep 10s
|
||||
MYSQL_PASSWORD=`pwgen -c -n -1 12`
|
||||
echo mysql root password: $MYSQL_PASSWORD
|
||||
echo $MYSQL_PASSWORD > /mysql-root-pw.txt
|
||||
mysqladmin -u root password $MYSQL_PASSWORD
|
||||
cp /app/application/config/database.php.tmpl /app/application/config/database.php
|
||||
sed -i "s/\(password...=.\).*/\1'${MYSQL_PASSWORD}';/g" /app/application/config/database.php
|
||||
mysql -e "CREATE DATABASE IF NOT EXISTS ospos; use ospos; source /app/database/tables.sql; source /app/database/constraints.sql;" -uroot -p${MYSQL_PASSWORD}
|
||||
touch /mysql-configured
|
||||
killall mysqld
|
||||
sleep 10s
|
||||
fi
|
||||
supervisord -n
|
||||
Reference in New Issue
Block a user