How to set laravel app on Digital Ocean under docker?
I installed laravel 5 app on Digital Ocean Server (under kubuntu 18) using Docker
So now url of mysite looks like
http://NNN.NN.NNN.N:8085/public/login
, where
http://NNN.NN.NNN.N - is ip of my server
8085 - port I set in docker-compose.yml file :
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
I want to include youtube video for this app, so I have to set client ID/ client secret and getting
Authorized redirect URIs I have to enter Authorized domains value like :
NNN.NN.NNN.N:8085
I got error message :
Invalid domain: cannot contain port.
Can you give me a hint how to salve this task?
have I to use new domain for this app, like https://my.freenom.com
But how to work with it as I have port set ?
MODIFIED BLOCK # 2:
I remade my project files:
docker-compose.yml:
version: '3.1'
services:
web:
image: jwilder/nginx-proxy
build:
context: ./web
dockerfile: Dockerfile.yml
environment:
- APACHE_RUN_USER =#1000
- VIRTUAL_HOST =my.freenom.com
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
db:
image: mysql:5.5.62
restart: always
environment:
MYSQL_ROOT_PASSWORD: 1
volumes:
- ${DB_PATH_HOST}:/var/lib/mysql
adminer:
image: adminer
restart: always
ports:
- 8086:80
links:
- db
composer:
image: composer:1.6
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
working_dir: ${APP_PTH_CONTAINER}
command: composer install --ignore-platform-reqs
web/Dockerfile.yml :
FROM nginx:1.10
RUN apt-get update -y && apt-get install -y libpng-dev
nano libmcrypt-dev
RUN docker-php-ext-install
pdo_mysql
mcrypt
&& a2enmod
rewrite
but running command :
docker-compose up -d --build
I got error :
docker-php-ext-install: not found
Could you please to look at files syntax above?
Thanks!
docker laravel-5 digital-ocean
add a comment |
I installed laravel 5 app on Digital Ocean Server (under kubuntu 18) using Docker
So now url of mysite looks like
http://NNN.NN.NNN.N:8085/public/login
, where
http://NNN.NN.NNN.N - is ip of my server
8085 - port I set in docker-compose.yml file :
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
I want to include youtube video for this app, so I have to set client ID/ client secret and getting
Authorized redirect URIs I have to enter Authorized domains value like :
NNN.NN.NNN.N:8085
I got error message :
Invalid domain: cannot contain port.
Can you give me a hint how to salve this task?
have I to use new domain for this app, like https://my.freenom.com
But how to work with it as I have port set ?
MODIFIED BLOCK # 2:
I remade my project files:
docker-compose.yml:
version: '3.1'
services:
web:
image: jwilder/nginx-proxy
build:
context: ./web
dockerfile: Dockerfile.yml
environment:
- APACHE_RUN_USER =#1000
- VIRTUAL_HOST =my.freenom.com
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
db:
image: mysql:5.5.62
restart: always
environment:
MYSQL_ROOT_PASSWORD: 1
volumes:
- ${DB_PATH_HOST}:/var/lib/mysql
adminer:
image: adminer
restart: always
ports:
- 8086:80
links:
- db
composer:
image: composer:1.6
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
working_dir: ${APP_PTH_CONTAINER}
command: composer install --ignore-platform-reqs
web/Dockerfile.yml :
FROM nginx:1.10
RUN apt-get update -y && apt-get install -y libpng-dev
nano libmcrypt-dev
RUN docker-php-ext-install
pdo_mysql
mcrypt
&& a2enmod
rewrite
but running command :
docker-compose up -d --build
I got error :
docker-php-ext-install: not found
Could you please to look at files syntax above?
Thanks!
docker laravel-5 digital-ocean
Do you have something running on Port 80 of the host? Can you not just do a port mapping to port 80 such as --> ports: -80:80
– Allan F. Gagnon
Dec 27 '18 at 15:32
I am not sure, but I would prefer not to take port 80 and left it free. Some other decisions ?
– mstdmstd
Dec 27 '18 at 15:47
1
Have you checked out this link from digital ocean? digitalocean.com/community/tutorials/…
– Allan F. Gagnon
Dec 27 '18 at 16:05
Or this blog post has a docker file--> medium.com/@shakyShane/…
– Allan F. Gagnon
Dec 27 '18 at 16:12
add a comment |
I installed laravel 5 app on Digital Ocean Server (under kubuntu 18) using Docker
So now url of mysite looks like
http://NNN.NN.NNN.N:8085/public/login
, where
http://NNN.NN.NNN.N - is ip of my server
8085 - port I set in docker-compose.yml file :
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
I want to include youtube video for this app, so I have to set client ID/ client secret and getting
Authorized redirect URIs I have to enter Authorized domains value like :
NNN.NN.NNN.N:8085
I got error message :
Invalid domain: cannot contain port.
Can you give me a hint how to salve this task?
have I to use new domain for this app, like https://my.freenom.com
But how to work with it as I have port set ?
MODIFIED BLOCK # 2:
I remade my project files:
docker-compose.yml:
version: '3.1'
services:
web:
image: jwilder/nginx-proxy
build:
context: ./web
dockerfile: Dockerfile.yml
environment:
- APACHE_RUN_USER =#1000
- VIRTUAL_HOST =my.freenom.com
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
db:
image: mysql:5.5.62
restart: always
environment:
MYSQL_ROOT_PASSWORD: 1
volumes:
- ${DB_PATH_HOST}:/var/lib/mysql
adminer:
image: adminer
restart: always
ports:
- 8086:80
links:
- db
composer:
image: composer:1.6
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
working_dir: ${APP_PTH_CONTAINER}
command: composer install --ignore-platform-reqs
web/Dockerfile.yml :
FROM nginx:1.10
RUN apt-get update -y && apt-get install -y libpng-dev
nano libmcrypt-dev
RUN docker-php-ext-install
pdo_mysql
mcrypt
&& a2enmod
rewrite
but running command :
docker-compose up -d --build
I got error :
docker-php-ext-install: not found
Could you please to look at files syntax above?
Thanks!
docker laravel-5 digital-ocean
I installed laravel 5 app on Digital Ocean Server (under kubuntu 18) using Docker
So now url of mysite looks like
http://NNN.NN.NNN.N:8085/public/login
, where
http://NNN.NN.NNN.N - is ip of my server
8085 - port I set in docker-compose.yml file :
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
I want to include youtube video for this app, so I have to set client ID/ client secret and getting
Authorized redirect URIs I have to enter Authorized domains value like :
NNN.NN.NNN.N:8085
I got error message :
Invalid domain: cannot contain port.
Can you give me a hint how to salve this task?
have I to use new domain for this app, like https://my.freenom.com
But how to work with it as I have port set ?
MODIFIED BLOCK # 2:
I remade my project files:
docker-compose.yml:
version: '3.1'
services:
web:
image: jwilder/nginx-proxy
build:
context: ./web
dockerfile: Dockerfile.yml
environment:
- APACHE_RUN_USER =#1000
- VIRTUAL_HOST =my.freenom.com
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
ports:
- 8085:80
working_dir: ${APP_PTH_CONTAINER}
db:
image: mysql:5.5.62
restart: always
environment:
MYSQL_ROOT_PASSWORD: 1
volumes:
- ${DB_PATH_HOST}:/var/lib/mysql
adminer:
image: adminer
restart: always
ports:
- 8086:80
links:
- db
composer:
image: composer:1.6
volumes:
- ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
working_dir: ${APP_PTH_CONTAINER}
command: composer install --ignore-platform-reqs
web/Dockerfile.yml :
FROM nginx:1.10
RUN apt-get update -y && apt-get install -y libpng-dev
nano libmcrypt-dev
RUN docker-php-ext-install
pdo_mysql
mcrypt
&& a2enmod
rewrite
but running command :
docker-compose up -d --build
I got error :
docker-php-ext-install: not found
Could you please to look at files syntax above?
Thanks!
docker laravel-5 digital-ocean
docker laravel-5 digital-ocean
edited Dec 28 '18 at 7:49
asked Dec 27 '18 at 15:06
mstdmstd
575414
575414
Do you have something running on Port 80 of the host? Can you not just do a port mapping to port 80 such as --> ports: -80:80
– Allan F. Gagnon
Dec 27 '18 at 15:32
I am not sure, but I would prefer not to take port 80 and left it free. Some other decisions ?
– mstdmstd
Dec 27 '18 at 15:47
1
Have you checked out this link from digital ocean? digitalocean.com/community/tutorials/…
– Allan F. Gagnon
Dec 27 '18 at 16:05
Or this blog post has a docker file--> medium.com/@shakyShane/…
– Allan F. Gagnon
Dec 27 '18 at 16:12
add a comment |
Do you have something running on Port 80 of the host? Can you not just do a port mapping to port 80 such as --> ports: -80:80
– Allan F. Gagnon
Dec 27 '18 at 15:32
I am not sure, but I would prefer not to take port 80 and left it free. Some other decisions ?
– mstdmstd
Dec 27 '18 at 15:47
1
Have you checked out this link from digital ocean? digitalocean.com/community/tutorials/…
– Allan F. Gagnon
Dec 27 '18 at 16:05
Or this blog post has a docker file--> medium.com/@shakyShane/…
– Allan F. Gagnon
Dec 27 '18 at 16:12
Do you have something running on Port 80 of the host? Can you not just do a port mapping to port 80 such as --> ports: -80:80
– Allan F. Gagnon
Dec 27 '18 at 15:32
Do you have something running on Port 80 of the host? Can you not just do a port mapping to port 80 such as --> ports: -80:80
– Allan F. Gagnon
Dec 27 '18 at 15:32
I am not sure, but I would prefer not to take port 80 and left it free. Some other decisions ?
– mstdmstd
Dec 27 '18 at 15:47
I am not sure, but I would prefer not to take port 80 and left it free. Some other decisions ?
– mstdmstd
Dec 27 '18 at 15:47
1
1
Have you checked out this link from digital ocean? digitalocean.com/community/tutorials/…
– Allan F. Gagnon
Dec 27 '18 at 16:05
Have you checked out this link from digital ocean? digitalocean.com/community/tutorials/…
– Allan F. Gagnon
Dec 27 '18 at 16:05
Or this blog post has a docker file--> medium.com/@shakyShane/…
– Allan F. Gagnon
Dec 27 '18 at 16:12
Or this blog post has a docker file--> medium.com/@shakyShane/…
– Allan F. Gagnon
Dec 27 '18 at 16:12
add a comment |
1 Answer
1
active
oldest
votes
You can use NGINX as a reverse proxy server (https://github.com/jwilder/nginx-proxy), and add an env-var called "virtual-host" to the container as follows:
docker run -d -p 80808:8080 -e VIRTUAL_HOST=my.freenom.com --name web your_image
or on your docker compose case
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
env:
- VIRTUAL_HOST: my.freenom.com
working_dir: ${APP_PTH_CONTAINER}
then configure a DNS to point to the machine ip, Once you have done that any requests matching the virtual host will be redirected to the container on the exposed port.
Thankl you for your feedback! That seems direction I need.Please look at MODIFIED BLOCK # 2
– mstdmstd
Dec 28 '18 at 7:50
@mstdmstd if this answer help you considere marking it as valid, anyway, for the block #2 that's a separate question that you should raise, a short recommendation is to use docker network instead of link because link is deprecated, also you need to use the volume specified in the docs for the nginx container.
– Shailyn Ortiz
Dec 28 '18 at 14:19
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53947103%2fhow-to-set-laravel-app-on-digital-ocean-under-docker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can use NGINX as a reverse proxy server (https://github.com/jwilder/nginx-proxy), and add an env-var called "virtual-host" to the container as follows:
docker run -d -p 80808:8080 -e VIRTUAL_HOST=my.freenom.com --name web your_image
or on your docker compose case
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
env:
- VIRTUAL_HOST: my.freenom.com
working_dir: ${APP_PTH_CONTAINER}
then configure a DNS to point to the machine ip, Once you have done that any requests matching the virtual host will be redirected to the container on the exposed port.
Thankl you for your feedback! That seems direction I need.Please look at MODIFIED BLOCK # 2
– mstdmstd
Dec 28 '18 at 7:50
@mstdmstd if this answer help you considere marking it as valid, anyway, for the block #2 that's a separate question that you should raise, a short recommendation is to use docker network instead of link because link is deprecated, also you need to use the volume specified in the docs for the nginx container.
– Shailyn Ortiz
Dec 28 '18 at 14:19
add a comment |
You can use NGINX as a reverse proxy server (https://github.com/jwilder/nginx-proxy), and add an env-var called "virtual-host" to the container as follows:
docker run -d -p 80808:8080 -e VIRTUAL_HOST=my.freenom.com --name web your_image
or on your docker compose case
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
env:
- VIRTUAL_HOST: my.freenom.com
working_dir: ${APP_PTH_CONTAINER}
then configure a DNS to point to the machine ip, Once you have done that any requests matching the virtual host will be redirected to the container on the exposed port.
Thankl you for your feedback! That seems direction I need.Please look at MODIFIED BLOCK # 2
– mstdmstd
Dec 28 '18 at 7:50
@mstdmstd if this answer help you considere marking it as valid, anyway, for the block #2 that's a separate question that you should raise, a short recommendation is to use docker network instead of link because link is deprecated, also you need to use the volume specified in the docs for the nginx container.
– Shailyn Ortiz
Dec 28 '18 at 14:19
add a comment |
You can use NGINX as a reverse proxy server (https://github.com/jwilder/nginx-proxy), and add an env-var called "virtual-host" to the container as follows:
docker run -d -p 80808:8080 -e VIRTUAL_HOST=my.freenom.com --name web your_image
or on your docker compose case
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
env:
- VIRTUAL_HOST: my.freenom.com
working_dir: ${APP_PTH_CONTAINER}
then configure a DNS to point to the machine ip, Once you have done that any requests matching the virtual host will be redirected to the container on the exposed port.
You can use NGINX as a reverse proxy server (https://github.com/jwilder/nginx-proxy), and add an env-var called "virtual-host" to the container as follows:
docker run -d -p 80808:8080 -e VIRTUAL_HOST=my.freenom.com --name web your_image
or on your docker compose case
version: '3.1'
services:
web:
build:
...
ports:
- 8085:80
env:
- VIRTUAL_HOST: my.freenom.com
working_dir: ${APP_PTH_CONTAINER}
then configure a DNS to point to the machine ip, Once you have done that any requests matching the virtual host will be redirected to the container on the exposed port.
answered Dec 27 '18 at 17:20
Shailyn Ortiz
546112
546112
Thankl you for your feedback! That seems direction I need.Please look at MODIFIED BLOCK # 2
– mstdmstd
Dec 28 '18 at 7:50
@mstdmstd if this answer help you considere marking it as valid, anyway, for the block #2 that's a separate question that you should raise, a short recommendation is to use docker network instead of link because link is deprecated, also you need to use the volume specified in the docs for the nginx container.
– Shailyn Ortiz
Dec 28 '18 at 14:19
add a comment |
Thankl you for your feedback! That seems direction I need.Please look at MODIFIED BLOCK # 2
– mstdmstd
Dec 28 '18 at 7:50
@mstdmstd if this answer help you considere marking it as valid, anyway, for the block #2 that's a separate question that you should raise, a short recommendation is to use docker network instead of link because link is deprecated, also you need to use the volume specified in the docs for the nginx container.
– Shailyn Ortiz
Dec 28 '18 at 14:19
Thankl you for your feedback! That seems direction I need.Please look at MODIFIED BLOCK # 2
– mstdmstd
Dec 28 '18 at 7:50
Thankl you for your feedback! That seems direction I need.Please look at MODIFIED BLOCK # 2
– mstdmstd
Dec 28 '18 at 7:50
@mstdmstd if this answer help you considere marking it as valid, anyway, for the block #2 that's a separate question that you should raise, a short recommendation is to use docker network instead of link because link is deprecated, also you need to use the volume specified in the docs for the nginx container.
– Shailyn Ortiz
Dec 28 '18 at 14:19
@mstdmstd if this answer help you considere marking it as valid, anyway, for the block #2 that's a separate question that you should raise, a short recommendation is to use docker network instead of link because link is deprecated, also you need to use the volume specified in the docs for the nginx container.
– Shailyn Ortiz
Dec 28 '18 at 14:19
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53947103%2fhow-to-set-laravel-app-on-digital-ocean-under-docker%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have something running on Port 80 of the host? Can you not just do a port mapping to port 80 such as --> ports: -80:80
– Allan F. Gagnon
Dec 27 '18 at 15:32
I am not sure, but I would prefer not to take port 80 and left it free. Some other decisions ?
– mstdmstd
Dec 27 '18 at 15:47
1
Have you checked out this link from digital ocean? digitalocean.com/community/tutorials/…
– Allan F. Gagnon
Dec 27 '18 at 16:05
Or this blog post has a docker file--> medium.com/@shakyShane/…
– Allan F. Gagnon
Dec 27 '18 at 16:12