Skip to content

Commit d769a10

Browse files
committed
Setup environment
1 parent 7a399df commit d769a10

File tree

16 files changed

+3071
-1095
lines changed

16 files changed

+3071
-1095
lines changed

service/.gitignore

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Use https://gitignore.io/ to create a suitable .gitignore file for your project.
2-
data/
3-
var/
4-
vendor/
52
.idea/
6-
node_modules/
3+
node_modules/
4+
5+
# Symfony env files
6+
/.env
7+
/.env.local
8+
/.env.dev
9+
/.env.*.local
10+
/.env.local.php
11+
/.env.*.local
12+
!/.env.example
13+
14+
/config/secrets/prod/prod.decrypt.private.php
15+
/public/bundles/
16+
/var/
17+
/vendor/

service/.gitignore copy

Lines changed: 0 additions & 10 deletions
This file was deleted.

service/Dockerfile

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
# Use a suitable base-image.
2-
FROM python:3-alpine
1+
FROM php:8.2-fpm
32

4-
# Create a seperate user and chown new directories if necessary
5-
RUN addgroup --system service
6-
RUN adduser --system --ingroup service --uid 1000 service
3+
RUN apt-get update && apt-get install -y \
4+
libpq-dev \
5+
git \
6+
unzip \
7+
nginx \
8+
&& docker-php-ext-install pdo pdo_pgsql
79

8-
# Create our mapped data volume endpoint
9-
RUN mkdir /data/
10+
WORKDIR /var/www/html
1011

11-
# Copy our entrypoint.sh and make it executable
12-
COPY entrypoint.sh /
13-
RUN chmod +x /entrypoint.sh
12+
# Install Composer
13+
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
1414

15-
# Copy our service
16-
COPY src/ /service/
15+
# Configure Nginx
16+
COPY docker/nginx.conf /etc/nginx/sites-available/default
1717

18-
# Change the working directory.
19-
WORKDIR /service/
20-
# Expose the service's port
21-
EXPOSE 8000
18+
# Make sure PHP-FPM and Nginx can write to var/log
19+
RUN mkdir -p var/log && chmod -R 777 var/log
2220

23-
# Run the service
24-
ENTRYPOINT ["/entrypoint.sh"]
21+
# Set recommended PHP.ini settings
22+
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
23+
24+
# Start Nginx and PHP-FPM
25+
COPY docker/start.sh /usr/local/bin/start
26+
RUN chmod +x /usr/local/bin/start
27+
28+
EXPOSE 80
29+
30+
CMD ["/usr/local/bin/start"]

service/composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,18 @@
77
"php": ">=8.2",
88
"ext-ctype": "*",
99
"ext-iconv": "*",
10+
"doctrine/dbal": "^3.9.4",
11+
"doctrine/doctrine-bundle": "^2.14",
12+
"doctrine/doctrine-migrations-bundle": "^3.4.1",
13+
"doctrine/orm": "^3.3.2",
1014
"symfony/console": "7.2.*",
1115
"symfony/dotenv": "7.2.*",
12-
"symfony/flex": "^2",
16+
"symfony/flex": "^2.5",
1317
"symfony/framework-bundle": "7.2.*",
1418
"symfony/runtime": "7.2.*",
19+
"symfony/twig-bundle": "7.2.*",
1520
"symfony/yaml": "7.2.*"
1621
},
17-
"require-dev": {
18-
},
1922
"config": {
2023
"allow-plugins": {
2124
"php-http/discovery": true,

0 commit comments

Comments
 (0)