ledo init
This commit is contained in:
5
app/templates/compose_template.go
Normal file
5
app/templates/compose_template.go
Normal file
@ -0,0 +1,5 @@
|
||||
package templates
|
||||
|
||||
var LedoDockerComposeBaseFileTemplate = `
|
||||
|
||||
`
|
52
app/templates/dockerfile_template.go
Normal file
52
app/templates/dockerfile_template.go
Normal file
@ -0,0 +1,52 @@
|
||||
package templates
|
||||
|
||||
var default_DockerFileTemplate = `
|
||||
FROM {{.Image}}/{{.Tag}}
|
||||
|
||||
ENV DIR /usr/local
|
||||
WORKDIR ${DIR}
|
||||
|
||||
# Copy entrypoint
|
||||
COPY docker/docker-entrypoint.sh /bin/docker-entrypoint.sh
|
||||
|
||||
# Copy project content
|
||||
COPY {{.ContainerContent}} $DIR
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD [""]
|
||||
`
|
||||
var php_DockerFileTemplate = `
|
||||
FROM paramah/{{.Tag}}
|
||||
ARG ENVIRONMENT=production
|
||||
|
||||
RUN ngxconfig sf.conf
|
||||
|
||||
ENV DIR /var/www
|
||||
WORKDIR ${DIR}
|
||||
|
||||
# Copy entrypoint
|
||||
COPY docker/docker-entrypoint.sh /bin/docker-entrypoint.sh
|
||||
RUN chmod +x /bin/docker-entrypoint.sh
|
||||
|
||||
# Develop packages
|
||||
RUN xdebug_enable
|
||||
|
||||
RUN usermod -u 1000 www-data && groupmod -g 1000 www-data
|
||||
RUN chown www-data:www-data ${DIR} && /bin/composer self-update --2
|
||||
USER www-data
|
||||
|
||||
# For Docker build cache
|
||||
COPY ./composer.* $DIR/
|
||||
RUN /bin/composer install --no-scripts --no-interaction --no-autoloader && composer clear-cache
|
||||
|
||||
# Copy application
|
||||
COPY --chown=www-data:www-data ./ $DIR
|
||||
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
EXPOSE 80
|
||||
# done
|
||||
|
||||
USER root
|
||||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
|
||||
`
|
18
app/templates/ledofile_template.go
Normal file
18
app/templates/ledofile_template.go
Normal file
@ -0,0 +1,18 @@
|
||||
package templates
|
||||
|
||||
var LedoConfigurationFileTemplate = `
|
||||
docker:
|
||||
registry: {{.Registry}}
|
||||
namespace: {{.Namespace}}
|
||||
name: {{.Name}}
|
||||
main_service: {{.MainService}}
|
||||
shell: {{.Shell}}
|
||||
{{- if ne .Username "root" }}
|
||||
username: {{.Username}}
|
||||
{{end}}
|
||||
modes:
|
||||
normal: docker/docker-compose.yml
|
||||
dev: docker/docker-compose.yml docker/docker-compose.dev.yml
|
||||
traefik: docker/docker-compose.yml docker/docker-compose.traefik.yml
|
||||
`
|
||||
|
Reference in New Issue
Block a user