-
Notifications
You must be signed in to change notification settings - Fork 41
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
already have nginx installed on server.... #4
Comments
I don't think you need to make any changes to the Dockerfile as it already exposes port 3000. If you are running nginx on your local host you can probably just alter the docker-compose to something like this, removing the nginx proxy and the version: '2.1'
services:
database:
image: mariadb
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=lobsters
healthcheck:
test: "/usr/bin/mysql --user=root --password=password --execute \"SHOW DATABASES;\""
timeout: 5s
retries: 20
volumes:
- 'lobsters_database:/var/lib/mysql'
app:
build:
context: .
args:
developer_build: "false"
environment:
- MARIADB_HOST=database
- MARIADB_PORT=3306
- MARIADB_PASSWORD=password
- MARIADB_USER=root
- LOBSTER_DATABASE=lobsters
- LOBSTER_SITE_NAME="Example News"
- RAILS_ENV=development
- LOBSTER_HOSTNAME=localhost
- VIRTUAL_HOST=localhost
- RAILS_MAX_THREADS=5
ports:
- "3000:3000"
depends_on:
database:
condition: service_healthy
volumes:
lobsters_database:
driver: local |
@chovy let me know if the above works for you, if not please give some additional details on your environment. |
I will try, another problem I'm having is I want to use a Mailgun SMTP server for sending email. |
I am not sure how to setup mailgun, but I just took some time to update this repo, so you might want to pull the new changes. I setup the build in circle-ci and updated the git submodule of lobsters to the most current git commit. I did this as i noticed the old build was no longer working |
the docker-compose now uses the pre-built image from https://hub.docker.com/r/utensils/lobsters |
With these new updates, you could pull try the following docker-compose version: '2.1'
services:
database:
image: mariadb
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=lobsters
healthcheck:
test: "/usr/bin/mysql --user=root --password=password --execute \"SHOW DATABASES;\""
timeout: 5s
retries: 20
volumes:
- 'lobsters_database:/var/lib/mysql'
app:
image: utensils/lobsters:latest
build:
context: .
args:
DEVELOPER_BUILD: "false"
environment:
- MARIADB_HOST=database
- MARIADB_PORT=3306
- MARIADB_PASSWORD=password
- MARIADB_USER=root
- LOBSTER_DATABASE=lobsters
- LOBSTER_SITE_NAME="Example News"
- RAILS_ENV=development
- LOBSTER_HOSTNAME=localhost
- VIRTUAL_HOST=localhost
- RAILS_MAX_THREADS=5
ports:
- "3000:3000"
depends_on:
database:
condition: service_healthy
volumes:
lobsters_database:
driver: local |
I need to configure the SMTP server somehow. |
@chovy there are ENV variables setup for using SMTP From the Dockerfile SMTP_HOST="127.0.0.1" \
SMTP_PORT="25" \
SMTP_STARTTLS_AUTO="true" \
SMTP_USERNAME="lobsters" \
SMTP_PASSWORD="lobsters" So given the previous docker-compose example you could simply add those variables. version: '2.1'
services:
database:
image: mariadb
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=lobsters
healthcheck:
test: "/usr/bin/mysql --user=root --password=password --execute \"SHOW DATABASES;\""
timeout: 5s
retries: 20
volumes:
- 'lobsters_database:/var/lib/mysql'
app:
image: utensils/lobsters:latest
build:
context: .
args:
DEVELOPER_BUILD: "false"
environment:
- MARIADB_HOST=database
- MARIADB_PORT=3306
- MARIADB_PASSWORD=password
- MARIADB_USER=root
- LOBSTER_DATABASE=lobsters
- LOBSTER_SITE_NAME="Example News"
- RAILS_ENV=development
- LOBSTER_HOSTNAME=localhost
- VIRTUAL_HOST=localhost
- RAILS_MAX_THREADS=5
- SMTP_HOST="your.smtp.host.com"
- SMTP_PORT="25"
- SMTP_STARTTLS_AUTO="true"
- SMTP_USERNAME="yoursmtpusername"
- SMTP_PASSWORD="yoursmtppass"
ports:
- "3000:3000"
depends_on:
database:
condition: service_healthy
volumes:
lobsters_database:
driver: local |
ahh ok. Trying now. Thanks. |
I tried connection to localhost:3000 but it isn't up. |
So I got it working, but mail still won't send. It says it can't find the config/initailizers/mail script
|
Ah I see this, i think the renamed the file upstream. I will fix this now |
if you pull the newest docker image |
Just an fyi, you can't use quotes in docker-compose for environemnt variables. They show up in the values. Also I read that docker-compose will look for a .env file in the root so that would be a better way of adding environment variables. I still get this error:
|
id' for nil:NilClass (NoMethodError)
|
@chovy this is the NilClass error i mentioned earlier, i think you can safely ignore it. once you have stories and comments it stops erroring. I think they really just need to put in a check for nil in that script. I doub't they ever see it because it only happens on fresh empty site. I added a story locally, changed a few things and it stopped coming back with that error. like i said it runs every 5 minutes so it can be safely ignored. |
I will look into adding this, that is probably a better idea. This project could use some work, I no longer run this anymore, but I do try to maintain the repo for others. I did run it for a bit with no issues, now the biggest issue is just keeping it updated :) |
did you have to make a lot of customizations to lobsters code? |
I got mail working! I had to use smtp.mailgun.org port 587. Shit works now! thank you! |
Something broke. I'm now getting this error.
|
@chovy I got my smtp server worked .
|
You cannot use localhost!!! |
How can I just expose the app on port 3000 so I can use my existing nginx proxy to server the application? Specifically what changes do I need to make to docker?
The text was updated successfully, but these errors were encountered: