-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting SQL server working on Docker #21
Comments
Hello Tom, I'm not familiar with docker, but I think the issue stands in your start.sh file. You run The |
Oh! nice, thanks !
If you want my environment variables:
|
Try with |
If the script is used by Docker to initialize a brand new instance of 2FAuth (with an empty database) each time it is run, you can simply use |
Hi @tomMoulard. Any progress with your Docker setup? I see you had problems with your sql server. Have you managed to set the project up with mysql before? |
Hi @OnlyFreeUsername, No chance on my side, I've been using 2FAuth with sqlite since. I've push a new branch on my repository to try to get postgresql working on Docker. Once all is complete, I still have this log (see attached file) If any of you get an idea on how to fix this, I'm all ears. Thanks ! |
Hello Tom, looks like the See line 125 of your logs:
But this should not occurs according to the docker-compose manual:
Regarding your first issueI tried to build/run with your setup (main branch of your repo, head detached to first commit) but without success: the php requirement fails at composer install:
How did you get the build to end successfully? |
arf, composer have upgraded the base image on 7 Jan, few days before your post : composer/docker@2577b32 |
I built my composer image myself based on your composer.lock file using php 7.3. I didn't get the configuration right but maybe you can start off with this dockerfile snippet: FROM php:7.3
WORKDIR /app
# install zip unzip extensions for composer
RUN apt-get update \
&& apt-get -y install zip unzip \
&& rm -rf /var/lib/apt/lists/*
# install composer on top of php:7.3 for composer.lock compatibility
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php \
&& php -r "unlink('composer-setup.php');" |
@OnlyFreeUsername You need to downgrade composer to its 1.10 branch because 2FAuth is not yet compatible with the 2.0 branch. Simply add |
Oh! I did not know that 2fauth did not work with composer 2. It is strange that I could build the image in the first place. But there is something strange when building:
Even when the enviromement variable is set to See the log attached, and the repository to build (using |
I'm not absolutely sure about this. Actually I have had some complains from the composer cli about the version during some of my builds so I downgrade to 1.10 branch to prevent any issue. I plan to push a new release of 2FAuth for some dependency updates with an upgraded composer.lock to clarify the situation. Regarding your
More to come soon |
Thank you very much 😄 And I've changed things:
And even with all those changes, I get an error:
|
hum... not sure your addition for RUN set -eux \
&& apk --no-cache add \
postgresql-dev
RUN docker-php-ext-install pdo_pgsql |
Thanks for the tip :) Doing the changes allow building and run the app, but I go an error when doing a cURL on the app:
Also, do you think I should install more dependencies for |
This is where I stand. And there is something really weird: When I look into the I checked existing tables in the It is beyond me why the hell all migrations have vanished! Can you confirm you have the same state? |
Ok, here is the error, in You bind an empty folder to a folder that already contains something, so docker empties it. volumes:
- './2fauth/db/:/2fauth/database' Simply remove the volume definition as it is useless with the postgres container and 2FAuth will run 😀 |
I've tried removing the volume, but the Test:
|
You cURLed |
Well, Laravel binds the |
Either way, after the successful start of the server, I still get a > curl localhost:8080
{
"message": "Server Error"
}{
"message": "Server Error"
}
|
Describe the bug
Hi there ! I've just made a repository to host my Dockerfile (and docker-compose.yml) for this project. But I can't figure out how to get a proper SQL server working with it.
To Reproduce
Steps to reproduce the behavior:
make
Expected behavior
Make should work and the server should be working localy. But instead, I get this:
Desktop (please complete the following information):
composer:2.0
4a9f73f6a1650d106b0844f2849b9cf091ca880c
)The text was updated successfully, but these errors were encountered: